SA-MP Forums Archive
Slow Timer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP DL Edition (https://sampforum.blast.hk/forumdisplay.php?fid=92)
+--- Forum: SA-MP 0.3.DL (https://sampforum.blast.hk/forumdisplay.php?fid=90)
+--- Thread: Slow Timer (/showthread.php?tid=646427)



Slow Timer - Nickk888 - 17.12.2017

Hello dear SAMP Community,

I've switched my server to 0.3.8 RC 4-3 today and I've gotten a very weird bug?
It's about my Timer or Timers for that matter... When i create a 1000ms timer, it's twice as slow than it should be! I've made a blank GM and a Benchmark test with GetTickCount which also gave me a ~2000ms result which is not okay!

It works perfectly on the 0.3.7 RC2 Version though...
Here's the Script:
Code:
#include <a_samp>
main() {}
new TickRate;
public OnGameModeInit() {
	TickRate = GetTickCount();
	SetTimer("SecondUpdate", 1000, true);
	return 1;
}
forward SecondUpdate();
public SecondUpdate() {
	printf("TickRate: %i", GetTickCount() - TickRate);
	TickRate = GetTickCount();
	return 1;
}
The result from console:


OnPlayerUpdate is also VERY slow! 80-120ms!!!

So is this a bug? I guess so...
Kalcor should fix this ASAP.. Because i don't want to devide the speed of my timers...


Re: Slow Timer - Sgt.TheDarkness - 17.12.2017

Wow, timers in sa-mp being horribly inaccurate, what a shocker.


Re: Slow Timer - Nickk888 - 17.12.2017

I know they are about 25% inaccurate, but not over 100%!!! But I've fixed it by changing the sleep value in the config file from 1 to 15 and it runs on ~1045ms which is fine by me... But an explanation about the sleep value would be great though...


Re: Slow Timer - beckzy - 17.12.2017

Quote:
Originally Posted by Nickk888
View Post
I know they are about 25% inaccurate, but not over 100%!!! But I've fixed it by changing the sleep value in the config file from 1 to 15 and it runs on ~1045ms which is fine by me... But an explanation about the sleep value would be great though...
https://sampwiki.blast.hk/wiki/Server.cfg


Re: Slow Timer - Nickk888 - 17.12.2017

Quote:
Originally Posted by BeckzyBoi
View Post
Yeah i get it now... But the default value in the Server CFG is not 5 but 1, just a hint for you guys...


Re: Slow Timer - RIDE2DAY - 17.12.2017

Quote:
Originally Posted by Nickk888
View Post
I know they are about 25% inaccurate, but not over 100%!!! But I've fixed it by changing the sleep value in the config file from 1 to 15 and it runs on ~1045ms which is fine by me... But an explanation about the sleep value would be great though...
It was set to 5 in 0.3.7 as far as I know, behaves pretty well for me like that. Increasing its value perhaps decreases the download speed of the custom models, supposing they're not being redirected.


Re: Slow Timer - beckzy - 17.12.2017

Quote:
Originally Posted by Nickk888
View Post
Yeah i get it now... But the default value in the Server CFG is not 5 but 1, just a hint for you guys...
sleep isn't new. It most likely has a default value of 5 prior to 0.3.8.


Re: Slow Timer - chneubeul - 17.12.2017

Hello

you have to consider the calltime of printf, make your calcul before print it

see you


Re: Slow Timer - DleyDeR - 17.12.2017

Just change sleep value in server.cfg from 1 to 3 and test it again.