Timer

R

RK

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.
 
R

Rob van Gelder

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
 
R

RK

Thanks Rob. Managed to get it to work.k


Rob van Gelder said:
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
 
Top