mIRC Home    About    Download    Register    News    Help

Print Thread
#33685 02/07/03 11:32 PM
Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
$ctime returns whole seconds...

is there a way to break it down smaller, into seconds.milliseconds format?

#33686 02/07/03 11:33 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
$calc($ctime * 1000)
that should make it milliseconds


new username: tidy_trax
#33687 02/07/03 11:34 PM
Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
eh its for a trivia bot tho and im wanting it to time with seconds:milliseconds format for best time. or 5.32 seconds or somethin like that ya know =/

#33688 02/07/03 11:38 PM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
tell me if this is right.

//echo -a $asctime($calc($ctime / 1000),n:ss)


new username: tidy_trax
#33689 02/07/03 11:51 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
var %ticks = $ticks
Stuff that happens
echo -a $calc($ticks - %ticks) ms

You can also do, $calc(($ticks - %ticks) / 1000) secs.
If minutes are involved, $gmt($calc(($ticks - %ticks) / 1000),n:ss) $+ . $+ $calc(($ticks - %ticks) % 1000)

This is an excepted standard for timing an event in milliseconds, for lack of anything better. This is by no means super accurate, but pretty accurate... only to a 10th of a second, maybe 100th.

This will display the number of milliseconds it took for Stuff to happen. $ticks is a system timer which more or less updates whenever the system is idle, and represents the number of milliseconds since the system was started... with minor accumulative inaccuracies.

I'm not sure if Khaled as worked out these inaccuracies, I just know he's made a number of changes to how $ticks works internally.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#33690 03/07/03 12:12 AM
Joined: Dec 2002
Posts: 111
E
Vogon poet
OP Offline
Vogon poet
E
Joined: Dec 2002
Posts: 111
awesome, works good smile $calc(($ticks - %time)/1000)


thanks!


Link Copied to Clipboard