Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Scripting
VBScript
 Timer Function

  Switch on low bandwidth view
This page is specific to
.NET Framework 3.0

Other versions are also available for the following:
Visual Basic Scripting Edition
Timer Function

Updated: April 2009

Returns the number of seconds that have elapsed since 12:00 AM (midnight).

Timer

The following example illustrates the use of the Timer function.

Dim StartTime, EndTime, Elapsed

MsgBox "Click to start timer.", vbExclamation
StartTime = Timer

MsgBox "Click to end timer.", vbExclamation
Elapsed = Timer - StartTime

' This works only if midnight does not occur between
' the two clicks.
MsgBox "Elapsed Seconds: " & Elapsed, vbInformation

Date

History

Reason

April 2009

Modified example.

Customer feedback.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker