Commit 4e762a38 by John Carr Committed by Jeff Law

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
parent 319f217e
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.
......
......@@ -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__ */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment