Solved

Simple Question about Time

Posted on 1998-10-21
3
861 Views
Last Modified: 2012-05-04
Hi,
I'm new in Delphi...

How I can take the time to do a Query in miliseconds ?

Thanks in advance !
0
Comment
Question by:aqm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1343812
Use the Win32 function GetSystemTime() or the Delphi Time function before and afterwards then work out the number of milliseconds between the two.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343813
To calculate the number of milliseconds do this (assuming you use the Delphi Time function):

var
 TimeAfter, TimeBefore : TDateTime;

.
TimeBefore := Time;
// Do your stuff here
TimeAfter := Time;

// How many milliseconds?
x := (TimeAfter - TimeBefore) * (86400 * 1000);  // 86400 seconds/day...


Cheers,

Raymond.

0
 

Expert Comment

by:chio
ID: 1343814
this is the statment to get millisecons from system time

var
  starttime,finishtime, actualresponse : TDateTime;
  Year, Month, Day, Hour, Min, Sec, MSec: Word;
begin
  starttime := Time;
  DecodeTime(starttime, Hour, Min, Sec, MSec);
  { display millisecons }
  label1.caption := inttostr(msec);

  Finishtime := Time;
  DecodeTime(finishtime, Hour, Min, Sec, MSec);
  { display millisecons }
  label2.caption := inttostr(msec);
 
{ you can also do this statment }
  actualresponse := finishtime - starttime;
  DecodeTime(actualresponse, Hour, Min, Sec, MSec);
  { display millisecons }
  label3.caption := inttostr(msec);

end;

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi application Soap connection 5 150
Firemonkey webbrowser scrollbars ? 1 65
How to build JSON File in Delphi 6 3 85
Slow Restore if incremental backups using RDiff.exe 4 48
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question