# help with some math

## Recommended Posts

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 on other sites

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 on other sites

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?

## Create an account

Register a new account

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...