toplev.c (get_run_time): Call sysconf(_SC_CLK_TCK), when available, to get clock rate.
* toplev.c (get_run_time): Call sysconf(_SC_CLK_TCK), when available, to get clock rate. From-SVN: r17454
This commit is contained in:
parent
319f217eca
commit
4e762a3831
@ -1,3 +1,8 @@
|
||||
Fri Jan 23 00:27:23 1998 John Carr <jfc@mit.edu>
|
||||
|
||||
* 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.
|
||||
|
10
gcc/toplev.c
10
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__ */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user