Timer

  • Thread starter Thread starter RK
  • Start date Start date
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.
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top