Rodney Radford wrote:
The man page states that clock "returns an approximation of processor time used by 
the program", which matches what you are getting under Linux. However, this link, 
http://www.cygwin.com/ml/cygwin/2003-10/msg01086.html, implies that under a Windows box 
clock actually returns the sum of the user-used-time and the system-used-time - ie: wall 
clock time. Now that doesn't answer your question of 'why', but does agree with what you 
are seeing.  Perhaps the issue is that Windows doesn't differentiate between windows and 
user time, or any time per process.

Which did you want to see - system time or wall-clock time as perhaps there is 
a better solution than using clock().
My intention was to see wall-clock time - do you know of something that will give me this in both windows and linux? If not, do you know something that will under linux (and I can just use preprocessor directives to check whether I am in Linux or Windows at compile time...)

Randy

--
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/

Reply via email to