Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Timer - milliseconds between 2 events


'API For Time keeping
Private Declare Function GetTickCount Lib "kernel32" () As Long

'use this throughout the program to time between two events
Dim iStart As Long , iEnd As Long , Result As String
iStart = GetTickCount
iEnd = GetTickCount
Result = FormatNumber((iEnd - iStart) / 1000, 3) & " seconds "