| View previous topic :: View next topic |
| Author |
Message |
ShavdApe Halfop
Joined: 15 Dec 2003 Posts: 46
|
Posted: Sat Jan 08, 2011 4:16 pm Post subject: Process timer |
|
|
Im looking to time how long a process takes, so that it can say search took xx seconds for eg.
I can get it to give me in seconds but since some will complete in less than a second I was wondering how to get miliseconds any help appreciated.
* edit *
I think i figured it out but please tell me if this is wrong
set starttime [clock clicks -milliseconds]
... what to time goes here
set endtime [clock clicks -milliseconds]
set timems "([expr $endtime - $starttime] ms)"
and $timems would be my time in miliseconds.
I hope thats correct as I say please let me know if im wrong. _________________ Driving lessons bolton |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Jan 08, 2011 4:49 pm Post subject: |
|
|
That should work. You might encounter the occasional situation when the millisecond value overlaps, yielding a negative "duration" though.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|