ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timer (https://www.excelbanter.com/excel-programming/294109-timer.html)

RK[_3_]

Timer
 
I've developed a math quiz for my children in Excel 2003, with randomly
generated addition, subtraction, multiplication & division problems. I had
to use a macro to copy randomly generated numbers as values, so they don't
recalculate all the time.

My daughter has now asked for a timer to measure how long she takes to
complete all the questions. How do I go about this?

Thanks.



Rob van Gelder[_4_]

Timer
 
I use this for speed testing different approaches in Excel, but for your
purposes this should work too.

Run the Test procedure as an example.


Declare Function timeGetTime Lib "winmm.dll" () As Long

Dim lngStart As Long

Sub Start()
lngStart = timeGetTime()
End Sub

Function Finish()
Finish = timeGetTime() - lngStart
End Function

Sub Test()
Start
MsgBox "click when ready"
MsgBox Finish & " milliseconds"
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"RK" wrote in message
...
I've developed a math quiz for my children in Excel 2003, with randomly
generated addition, subtraction, multiplication & division problems. I had
to use a macro to copy randomly generated numbers as values, so they don't
recalculate all the time.

My daughter has now asked for a timer to measure how long she takes to
complete all the questions. How do I go about this?

Thanks.





RK[_3_]

Timer
 
Thanks Rob. Managed to get it to work.k


"Rob van Gelder" wrote in message
...
I use this for speed testing different approaches in Excel, but for your
purposes this should work too.

Run the Test procedure as an example.


Declare Function timeGetTime Lib "winmm.dll" () As Long

Dim lngStart As Long

Sub Start()
lngStart = timeGetTime()
End Sub

Function Finish()
Finish = timeGetTime() - lngStart
End Function

Sub Test()
Start
MsgBox "click when ready"
MsgBox Finish & " milliseconds"
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"RK" wrote in message
...
I've developed a math quiz for my children in Excel 2003, with randomly
generated addition, subtraction, multiplication & division problems. I

had
to use a macro to copy randomly generated numbers as values, so they

don't
recalculate all the time.

My daughter has now asked for a timer to measure how long she takes to
complete all the questions. How do I go about this?

Thanks.








All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com