There are a number of time fetching functions out there, some obsoleted by others: ftime() is obsoleted by gettimeofday() under BSD 4.2. gettimeofday() is defined in SVr4 and BSD4.3. They are both used to find out actual time since 1970-01-01 down to at least a millisecond. times() is more known than getrusage() and is defined in POSIX and X/OPEN among others. getrusage() is only defined in SVr4 and BSD4.3. These are used to fetch CPU time (user time), which is the number of clock ticks since system startup, down to the microseconds. >From those facts, it seems like of all the time fetching functions that have the biggest chance of existing are times() and gettimeofday(). I'm fiddling with apps/speed.c to see if I can rid of ftime() as much as possible, and am wondering what assumptions I can make about different systems. All I want to know is the likelyhood that each of the functions mentioned exist on a particular system. For now, I'm assuming that gettimeofday() and times() can be used by default. If gettimeofday() doesn't exist, is there a way for me to get to know that. Same goes for times(). I plan to use ftime() as the absolutely last resort, when all else is lost... -- Richard Levitte \ Spannv�gen 38, II \ [EMAIL PROTECTED] Chairman@Stacken \ S-168 35 BROMMA \ T: +46-8-26 52 47 Redakteur@Stacken \ SWEDEN \ or +46-709-50 36 10 Procurator Odiosus Ex Infernis -- [EMAIL PROTECTED] Member of the OpenSSL development team: http://www.openssl.org/ Software Engineer, Celo Communications: http://www.celocom.com/ Unsolicited commercial email is subject to an archival fee of $400. See <http://www.stacken.kth.se/~levitte/mail/> for more info. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
ftime, times, gettimeofday and getrusage
Richard Levitte - VMS Whacker Fri, 13 Oct 2000 14:01:06 -0700
