diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d653f0b8b66..5ab4020d7a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 23 00:27:23 1998 John Carr + + * toplev.c (get_run_time): Call sysconf(_SC_CLK_TCK), when available, + to get clock rate. + Fri Jan 23 00:19:36 1998 Gavin Kock (gavin@cygnus.com) * mips.md (muldi3_internal2): Reverse test for TARGET_MIPS16. diff --git a/gcc/toplev.c b/gcc/toplev.c index 83873006689..7c24242bf58 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1021,6 +1021,15 @@ get_run_time () else return (clock() * 1000); #else /* not _WIN32 */ +#ifdef _SC_CLK_TCK + { + static int tick; + if (tick == 0) + tick = 1000000 / sysconf(_SC_CLK_TCK); + times (&tms); + return (tms.tms_utime + tms.tms_stime) * tick; + } +#else #ifdef USG times (&tms); return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ); @@ -1034,6 +1043,7 @@ get_run_time () return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000; #endif /* VMS */ #endif /* USG */ +#endif /* _SC_CLK_TCK */ #endif /* _WIN32 */ #endif /* __BEOS__ */ }