Return the difference Between Two or More Instances in HH:MM:SS

Category:
Dates and Math
Type:
Modules
Difficulty:
Intermediate
Author:
Robert Pendland

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This is totally independent of a Timer, but it can work in conjunction with a Timer if a counter is desired. Once you Call the StartTimer Sub, you can Call the ElapsedTime() function. The function returns a string in the HH:MM:SS format. ElapsedTime() can be called as many times as needed. The StopTimer Sub is called to cease the count, then the ElapsedTime() is called for the return string.

I documented the heck out of this. I know that many will cringe, but you can remove unwanted comments easy enough.

Enjoy

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: