Hi - I have been making an activity that gives a person 60 seconds to complete a task. At the moment I have done this by having a sub-routine that runs a wait function (code below). In case you don't know this procedure takes 60 seconds to run and thereafter the rest of the original sub-routine code is run which contains an end sequence. The Wait function allows other codes and processes to run as it uses the DoEvents command (which take place through clicks of other buttons). My observation is, this works excellently on a Macintosh, but less so on Windows machines. One Windows machine it takes approximately one second for a user's click on a tile to be shown on the screen. Meanwhile, on another slightly older Windows machine the cursor permanently changes to a circle that goes around and a around! (I note that if I take the wait command out then the program runs very fast which shows that this function is noticeably slowing the machine down.)

My question is, is there another way of having a sixty second timer which will automatically trigger some code when the time is up? I want it to work on both Macintosh and Windows - not just one of them!

Thank you for any ideas!


Sub Start() 'This sub-routine creates the game and then sets the 60 second timer by calling the "Wait" function

    ActivePresentation.SlideShowWindow.View.Next

    Wait 'this is a function that runs a 60 second timer

    'I note that when 60 seconds has passed the wait function finishes and the rest of the code within this sub-routine is run!

End Sub


Sub Wait() 'this is a 59 second timer
    Dim waitTime As Long
    Dim Start As Long
    waitTime = 59
    Start = Timer
    While Timer < Start + waitTime
        DoEvents
    Wend
End Sub