Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
k_starling
Beginner


Joined: 06 Aug 2010
Posts: 11

PostPosted: Fri Aug 06, 2010 6:34 am   

3.22a - %secs not working as intended?
 
%secs is supposed to be the number of milliseconds since midnight, according to the predefined variable reference, however it looks like this is equal to system uptime (in milliseconds) at the moment. Can it be changed back to showing milliseconds after midnight? It was a lot more useful that way.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Aug 06, 2010 3:07 pm   
 
You're right that it represents the up time. However it doesn't say it starts from midnight, it just says
Quote:
a millisecond precision timer


In zMUD this was specifically from midnight but that has changed now.
_________________
Asati di tempari!
Reply with quote
k_starling
Beginner


Joined: 06 Aug 2010
Posts: 11

PostPosted: Fri Aug 06, 2010 5:28 pm   
 
The cmud documentation also states that the time is measured starting at midnight. In any event, precision or no, I find milliseconds since midnight to be far more useful than system uptime. I, for one, would very much like to have the milliseconds-since-midnight functionality available again... perhaps change %secs back and add something like %uptime if for some reason system uptime is desired? Just an idea.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Aug 06, 2010 7:25 pm   
 
Exactly where in the documentation did you find that exactly? I've trying to find that in the documentation and don't see it myself.

The reason for the change wasn't to provide the system uptime but (if memory serves correctly) improve the accuracy of the %secs function.

What exactly are you trying to do that benefits from a midnight start?
_________________
Asati di tempari!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Aug 06, 2010 9:48 pm   
 
Well, the %secs functionality based on midnight allowed people to calculate things during the given day rather than based on uptime. For instance, if I wanted to know what my average kill speed was during the given day, I could have used %secs based on the midnight setting instead of having to create a variable that sets %secs at midnight. While this may be an absurd script, it's an idea of how %secs based on midnight evaluation is better than uptime evaluation.

Personally, I wouldn't mind having a time reference from midnight again, even if it's a whole new function.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Aug 09, 2010 4:31 pm   
 
The %secs functions comes from the Windows high-precision timer, which as you noticed is the uptime and *not* the time since midnight. This cannot be changed and still retrain the high precision nature of %secs. %secs was intended for high-precision timing and not for "time of day" calculations. If you need the number of milliseconds since midnight you should be able to use the %time function to obtain that.

The advantage of using uptime for %secs is also that it never "rolls over". So when you want to time how long something takes, you can safely subtract the ending %secs from the starting %secs without ever worrying about this value being negative (which happens in zMUD if midnight occurred in the middle of the timed test).
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net