Solved

Simple Question about Time

Posted on 1998-10-21
3
854 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 126
FMX enumerated colours 2 84
FMX StringGrid1->Canvas->FillRect Problem 3 127
Mobile Keyboard covers the display of the TMemo 3 78
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now