Jump to content
Sign in to follow this  
AustrianOak

help with some math

Recommended Posts

AustrianOak

i need some help with a bit of math for a sec..

If Round(Int(TimerDiff($aTimer_Inits[1])) / 5000 / 60 , 2) >= $nTrial Then $nDays_Over += 5

that line basically means if 5 minutes has gone by then set $nDays_Over to 5

5000/60 is 5 minutes i know that for sure....

but what is 5 days?

just 5000 maybe?

Share this post


Link to post
Share on other sites
martin

i need some help with a bit of math for a sec..

If Round(Int(TimerDiff($aTimer_Inits[1])) / 5000 / 60 , 2) >= $nTrial Then $nDays_Over += 5

that line basically means if 5 minutes has gone by then set $nDays_Over to 5

5000/60 is 5 minutes i know that for sure....

but what is 5 days?

just 5000 maybe?

I expect you would be better off using date functions if yu want to deal with days. Have a look at Date.au3 in the includes.

1000ms is 1 second, so 5 seconds is 5000mS as you say. 5 days is 1000*60*60*24*5.

(1000ms/sec)*(60sec/min)*(60min/hr)*(24hr/day)*5day


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
AustrianOak

so since this is 5 minutes

If Round(Int(TimerDiff($aTimer_Inits[1])) / 5000 / 60 , 2) >= $nTrial Then $nDays_Over += 5
i would change it to look like this so it would be 5 days?
If Round(Int(TimerDiff($aTimer_Inits[1])) * 1000 * 60 * 60 * 24 * 5 , 2) >= $nTrial Then $nDays_Over += 5

did i do everything correct?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×