AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Start / Finish Time. Calulate How Long a Script Running.

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Precise



Joined: 30 Dec 2007
Posts: 18
Location: East Coast

PostPosted: Sun Dec 30, 2007 4:55 pm    Post subject: Start / Finish Time. Calulate How Long a Script Running. Reply with quote

What I need to do is get the time when a script begins and when it finishes so that I can calculate how long that time period was. I'm fairly new to AHK, but not to coding in general. The stuff in the help file really only talks about formatting, I'm unsure of how to actually get the time value. I have no idea how to perform the calculations either once I have the value.

I was also wondering if there was a way to display the current time in a GUI. Is it possible to embed the windows time display / clock in a GUI?

Any help would be appreciated. Thanks.
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6847
Location: Pacific Northwest, US

PostPosted: Sun Dec 30, 2007 4:57 pm    Post subject: Reply with quote

start with A_TickCount. there are other ways to measure time (Like the performance counter), but A_TickCount is usually good enough. just save it to a variable at the start, check it again at the end, and do the math to display it.

if you make your own gui, guicontrol will let you update the time in the window (try using settimer)

to read out real time, see formattime

to do math on time, see envadd or envsub.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group