Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I know you can pause a macro for a certain number of milliseconds using
Public Declare Sub Sleep Lib "kernel32" _ (ByVal dwMilliseconds As Long) Option Private Module but I want to know the time between a certain number of iterations. The code runs too fast per iteration to calculate using seconds, and I can't seem to figure out how to measure more precisely. My code is as follows: Function timeRemaining(lastTime, curRow, endRow, cycles) lastTime = CDbl(lastTime) Dim timeNow As Double Dim cyclesLeft As Long timeNow = CDbl(Time) cyclesLeft = Int((endRow - curRow) / cycles) timeRemaining = format(CDate((timeNow - lastTime) * cyclesLeft), "h:mm:ss") lastTime = CDbl(Time) End Function Thanks for your help, Pflugs |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding and Subtracting a Time with MilliSeconds | Excel Worksheet Functions | |||
Time-scale chart measured in hours & minutes | Charts and Charting in Excel | |||
charting time series with milliseconds with scatter | Charts and Charting in Excel | |||
Comparing time values which have milliseconds in them e.g 10:20:30 | Excel Discussion (Misc queries) | |||
Grab Time with milliseconds included in VBA | Excel Programming |