We help IT Professionals succeed at work.

how many Runs a second?

eNarc
eNarc asked
on
168 Views
Last Modified: 2011-10-03
Hi I'd like to know how many Runs a second the function will do.


you know when you see these programs exporting data from the database, it tells you how many entrys are being exported per second, is there a way of doing this? with a function?
Comment
Watch Question

Commented:
Use a timer based on QuryPerformanceCounter to time the function.  


var start, finish : int64;

QueryPerformanceCounter(start)
//call your function
QueryPerformanceCounter(finish);

delta := finish - start


Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:

var t:TDateTime;
begin
t:=now;
showmessage('some function');
t:=t-now;
caption:=FormatDateTime('hh:mm:ss(zzz)',t);
...

Open in new window

Commented:
wd123:

Your solution is accurate to about 50 milliseconds, (and most functions would not take that long to execute, and you may end zero time of execution) (Timer updates about 19 times per second, so "now" is limited by that).

The solution using PerformanceCounters has a much higher accuracy level. At least about a third of a micro second in all computers, and even better in most computers.

Commented:
i know it.

Commented:
Good, Thanks.  

In such a case, please point it out when you post your solution in the future (especially when another suggestion that is way better than the one your are posting is already up there).

Commented:
If you're trying to make the performance better, you can use a profiling tool such as AQ Time. You can run your application through AQ Time, and it reads all the procedures/functions called in the process. It gives you statistics about how many times they are called, how much time it is needed to complete the procedure (relative). The timing you'll get is relative, meaning that it takes time to notice the statistics so your process will run slower than usual. The timing on AQ time is relative to each other; in that way you will be able to see which procedure formed the bottle neck to the whole process.

If you need this for your work, you can ask the company to purchase one
http://www.automatedqa.com/products/aqtime/
It's worth the investation.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.