diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-10-08 02:03:07 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-10-08 02:03:07 +0200 |
commit | d0153ea165f2745e19db9d2c245bc37092a3893c (patch) | |
tree | a034072e2a191de283d0f759c692852a8e0e95e8 /tune/time.c | |
parent | b72cc1cf9a8910e80ab905349ca721f467a78122 (diff) | |
download | gmp-d0153ea165f2745e19db9d2c245bc37092a3893c.tar.gz |
* tune/time.c (speed_time_init): Allow for Cray times() apparently
being a cycle counter.
Diffstat (limited to 'tune/time.c')
-rw-r--r-- | tune/time.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tune/time.c b/tune/time.c index 5fbb6a7e9..52e486199 100644 --- a/tune/time.c +++ b/tune/time.c @@ -985,6 +985,13 @@ speed_time_init (void) DEFAULT (speed_precision, (cgt_unittime <= 0.1e-6 ? 10000 : 1000)); strcpy (speed_time_string, "microsecond accurate getrusage()"); } + else if (have_times && clk_tck() > 1000000) + { + /* Cray vector systems have times() which is clock cycle resolution + (eg. 450 MHz). */ + DEFAULT (speed_precision, 10000); + goto choose_times; + } else if (have_grus && getrusage_microseconds_p()) { use_grus = 1; @@ -1006,10 +1013,11 @@ speed_time_init (void) } else if (have_times) { - use_times = 1; use_tick_boundary = 1; - speed_unittime = times_unittime = 1.0 / (double) clk_tck (); DEFAULT (speed_precision, 200); + choose_times: + use_times = 1; + speed_unittime = times_unittime = 1.0 / (double) clk_tck (); sprintf (speed_time_string, "%s clock tick times()", unittime_string (speed_unittime)); } |