GetTickCount API Routine Is Faster Than Timer

The Timer’s “roll-over” point is 24 hours. Since Timer only returns seconds, using GetTickCount also gives you a much higher resolution.

Declare

Declare Function GetTickCount Lib "User"() As Long

Usage

Dim lTimer1 as Long
lTimer1 = GetTickCount()

 

This tip is reprinted from the VB Tips & Tricks Volume 1 book.

Compatible With: Visual Basic 3.0, Visual Basic 4.0 16-bit


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.