egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Process timer

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
ShavdApe
Halfop


Joined: 15 Dec 2003
Posts: 46

PostPosted: Sat Jan 08, 2011 4:16 pm    Post subject: Process timer Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Jan 08, 2011 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber