Timer Function

Syntax

Timer

Return Value

A Single.

Description

Returns the number of seconds since midnight.

Programming Tips and Gotchas

  • You can use the Timer function as an easy method of passing a seed number to the Randomize statement, as follows:

    Randomize Timer

  • The Timer function is ideal for measuring the time taken to execute a procedure or program statement, as the following snippet shows:

    Dim sStartTime As Single
    Dim i As Integer
        
    sStartTime = Timer
        For i = 1 To 100
            Debug.Print "Hello"
        Next i
    MsgBox "Time Taken = " & Timer - sStartTime & " Seconds"

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.65.247