Slow Timer
#1

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...
Reply
#2

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

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...
Reply
#4

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
Reply
#5

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...
Reply
#6

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.
Reply
#7

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.
Reply
#8

Hello

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

see you
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)