Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Measuring time
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 1033 of 1098
Post > Topic >>

Measuring time

by kostas.tzoumas@[EMAIL PROTECTED] Jan 12, 2008 at 07:01 PM

Hello,

Imagine having to implement a priority scheduler which will measure
the time needed by various C functions and eventually favor the
function with the lowest running time. What do I have to measure - CPU
time or calendar time? The problem is that this has to do with a
database so I/O time is important. The way I am doing it so far is

gettimeofday(&timeBefore, NULL);
callSomeFunction();
gettimeofdat(&timeAfter, NULL);
// manipulate times here

but I have the feeling it's not correct when the program goes into the
OS scheduler with other processes. The application is not multi-
threaded.

Thank you in advance
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.




 4 Posts in Topic:
Measuring time
kostas.tzoumas@[EMAIL PRO  2008-01-12 19:01:04 
Re: Measuring time
=?ISO-8859-1?Q?Hans-Bernh  2008-01-14 12:49:54 
Re: Measuring time
Keith Thompson <kst-u@  2008-02-17 12:04:02 
Re: Measuring time
=?ISO-8859-1?Q?Hans-Bernh  2008-03-08 12:19:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 18:23:08 CDT 2008.