[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Simple Question about Time

Posted on 1998-10-21
3
Medium Priority
?
866 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 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

656 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