Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread MilliSecondsBetween function ?
Tue, Aug 9 2016 1:04 PMPermanent Link

Trinione

I can't figure out how to calculate the MilliSeconds Between a start time and the current time.

Any assistance would be appreciated.
Wed, Aug 10 2016 1:50 AMPermanent Link

Michael Dreher

//  Trinione wrote:
//
I can't figure out how to calculate the MilliSeconds Between a start time and the current time.
// Any assistance would be appreciated.

var
 FStartTime  : DateTime;
 milliseconds : integer;
 // ...
 FStartTime := Time();

 milliseconds := integer(Time() - integer(FStartTime);
Wed, Aug 10 2016 1:56 AMPermanent Link

Michael Dreher

//  Trinione wrote:
//
I can't figure out how to calculate the MilliSeconds Between a start time and the current time.
// Any assistance would be appreciated.

This should work (see code example):

var
 FStartTime  : DateTime;
 milliseconds : integer;
 // ...
 FStartTime := Time();
 //
 milliseconds := integer(Time()) - integer(FStartTime);

The resolution for Time() on my machine and my browser is ms (but is this the general case?), so it's a simple difference.

Michael Dreher



Attachments: Code.zip
Wed, Aug 10 2016 9:43 AMPermanent Link

Trinione

Michael :
Yes. This works. I was using the Now function.

Thank you very much.
Image