The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timerd not working properly?
Author Message
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #11
RE: Timerd not working properly?
The problem is that timerd is imprecise and unreliable for "precision" timing; it would be still acceptable an error of +-0.2, but right now it's bigger.
Consider this, on a vanilla sphere (default scripts, empty world) running on a i7:
Code:
10:13:(funzioni.scp,14)timerd: 6245; it should trigger at 6260
10:13:1:'dnolok' commands 'timerdtest 15'=1
10:13:(funzioni.scp,7)timerd fired: 6263
10:13:(funzioni.scp,14)timerd: 6283; it should trigger at 6298
10:13:1:'dnolok' commands 'timerdtest 15'=1
10:13:(funzioni.scp,7)timerd fired: 6303
10:13:(funzioni.scp,14)timerd: 6333; it should trigger at 6348
10:13:1:'dnolok' commands 'timerdtest 15'=1
10:13:(funzioni.scp,7)timerd fired: 6353
10:13:(funzioni.scp,14)timerd: 6361; it should trigger at 6376
10:13:1:'dnolok' commands 'timerdtest 15'=1
10:13:(funzioni.scp,7)timerd fired: 6383

In this case the problem may not be the performance.
01-18-2016 07:22 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #12
RE: Timerd not working properly?
Precision is very randomic, sometimes it's very precise, but usually it is not. The issue is major when you set TIMERD = 1 or 2 rather than 12 or 15, since you expect a very close response and you can wait for it even for more than a second.

Code:
:43:(test.scp,14)timerd: 76961229; it should trigger at 76961231
12:43:1:'dnolok' commands 'timerdtest 2'=1
12:43:(test.scp,7)timerd fired: 76961231
12:43:(test.scp,14)timerd: 76961300; it should trigger at 76961302
12:43:1:'dnolok' commands 'timerdtest 2'=1
12:43:(test.scp,7)timerd fired: 76961311
12:43:(test.scp,14)timerd: 76961319; it should trigger at 76961321
12:43:1:'dnolok' commands 'timerdtest 2'=1
12:43:(test.scp,7)timerd fired: 76961321
12:43:(test.scp,14)timerd: 76961335; it should trigger at 76961336
12:43:1:'dnolok' commands 'timerdtest 1'=1
12:43:(test.scp,7)timerd fired: 76961341
12:43:(test.scp,14)timerd: 76961380; it should trigger at 76961381
12:43:1:'dnolok' commands 'timerdtest 1'=1
12:43:(test.scp,7)timerd fired: 76961381
12:43:(test.scp,14)timerd: 76961390; it should trigger at 76961391
12:43:1:'dnolok' commands 'timerdtest 1'=1
12:43:(test.scp,7)timerd fired: 76961391
12:43:(test.scp,14)timerd: 76961403; it should trigger at 76961404
12:43:1:'dnolok' commands 'timerdtest 1'=1
12:43:(test.scp,7)timerd fired: 76961411
12:43:(test.scp,14)timerd: 76961494; it should trigger at 76961495
12:43:1:'dnolok' commands 'timerdtest 1'=1
12:43:(test.scp,7)timerd fired: 76961501
12:43:(test.scp,14)timerd: 76961508; it should trigger at 76961511
12:43:1:'dnolok' commands 'timerdtest 3'=1
12:43:(test.scp,7)timerd fired: 76961511
12:43:(test.scp,14)timerd: 76961541; it should trigger at 76961543
12:43:1:'dnolok' commands 'timerdtest 2'=1
12:43:(test.scp,7)timerd fired: 76961551
01-21-2016 09:47 PM
Find all posts by this user Like Post Quote this message in a reply
rastrero
Master
**

Posts: 250
Likes Given: 41
Likes Received: 28 in 24 posts
Joined: Jan 2016
Reputation: 3



Post: #13
RE: Timerd not working properly?
Should be nice if its fixed...

I use timerd for many functions of effect.

Anyway I can fix this by my self? Or to help u with?
01-22-2016 12:51 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #14
RE: Timerd not working properly?
I don't know the source so well to be able to fix a complex thing like this ^^'
01-22-2016 02:57 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #15
RE: Timerd not working properly?
Up. Is there a way to fix this?
02-07-2016 05:10 AM
Find all posts by this user Like Post Quote this message in a reply
ForesteR
Apprentice
*

Posts: 45
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2015
Reputation: 0



Post: #16
RE: Timerd not working properly?
and TimerCall=1 on ini run in 14-15 min... i think =1 is equal 1min.. no?
02-07-2016 05:23 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #17
RE: Timerd not working properly?
Yes but this would solve what? ^^' TimerCall is the amount of minutes to call f_onserver_timer.
02-07-2016 10:11 PM
Find all posts by this user Like Post Quote this message in a reply
ForesteR
Apprentice
*

Posts: 45
Likes Given: 1
Likes Received: 0 in 0 posts
Joined: May 2015
Reputation: 0



Post: #18
RE: Timerd not working properly?
i think is the same problem on others ticks
02-08-2016 01:42 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #19
RE: Timerd not working properly?
probably it happen because the main internal timer on sphere (including <SERV.TIME>) is based on CPU clocks (ticks per second) instead system time (miliseconds)

system time is a timestamp based on real calendar time, but system ticks is a timestamp based on CPU clocks since latest system restart, which does the job if you don't need much precision, but if you need it (like in topic example) it won't have a perfect timer because every CPU has a difference of 10~20ms between each tick

so maybe there's nothing left to do in this case, there's no way to get perfect timers or <SERV.TIME> values unless change the sphere main internal timer to use system time (miliseconds) instead CPU clock (ticks per second). It's not difficult to change it, but honestly I don't know if this will bring any advantage since ~maybe~ this could make sphere consume more CPU usage
02-15-2016 10:45 AM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #20
RE: Timerd not working properly?
If the change isn't difficult and doesn't break anything i would give it a try (even if it would be better to read other opinions on the CPU usage).
02-17-2016 07:30 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)