Last change
on this file since 325 was
134,
checked in by kane, 14 years ago
|
add multi write buffer in cc_xcache_v4
|
File size:
1.9 KB
|
Rev | Line | |
---|
[134] | 1 | /*****************************************************/ |
---|
| 2 | /* Various timer routines. */ |
---|
| 3 | /* Al Aburto, aburto@nosc.mil, 18 Feb 1997 */ |
---|
| 4 | /* */ |
---|
| 5 | /* t = dtime() outputs the current time in seconds. */ |
---|
| 6 | /* Use CAUTION as some of these routines will mess */ |
---|
| 7 | /* up when timing across the hour mark!!! */ |
---|
| 8 | /* */ |
---|
| 9 | /* For timing I use the 'user' time whenever */ |
---|
| 10 | /* possible. Using 'user+sys' time is a separate */ |
---|
| 11 | /* issue. */ |
---|
| 12 | /* */ |
---|
| 13 | /* Example Usage: */ |
---|
| 14 | /* [timer options added here] */ |
---|
| 15 | /* main() */ |
---|
| 16 | /* { */ |
---|
| 17 | /* double starttime,benchtime,dtime(); */ |
---|
| 18 | /* */ |
---|
| 19 | /* starttime = dtime(); */ |
---|
| 20 | /* [routine to time] */ |
---|
| 21 | /* benchtime = dtime() - starttime; */ |
---|
| 22 | /* } */ |
---|
| 23 | /* */ |
---|
| 24 | /* [timer code below added here] */ |
---|
| 25 | /*****************************************************/ |
---|
| 26 | |
---|
| 27 | /*********************************/ |
---|
| 28 | /* Timer code. */ |
---|
| 29 | /*********************************/ |
---|
| 30 | |
---|
| 31 | #include "dhry.h" |
---|
| 32 | #include "system.h" |
---|
| 33 | |
---|
| 34 | /***************************************************/ |
---|
| 35 | /* dtime(). */ |
---|
| 36 | /***************************************************/ |
---|
| 37 | #ifdef HAVE_DOUBLE |
---|
| 38 | # ifndef MHZ |
---|
| 39 | # define MHZ (1000000.0) |
---|
| 40 | # endif //!MHZ |
---|
| 41 | |
---|
| 42 | # ifndef FRQ |
---|
| 43 | # define FRQ (1*MHZ) |
---|
| 44 | # endif //!FRQ |
---|
| 45 | #endif |
---|
| 46 | |
---|
| 47 | DOUBLE dtime() |
---|
| 48 | { |
---|
| 49 | DOUBLE q; |
---|
| 50 | |
---|
| 51 | #ifdef HAVE_DOUBLE |
---|
| 52 | q = (DOUBLE)(cpu_cycles())/(DOUBLE)FRQ; |
---|
| 53 | #else |
---|
| 54 | q = (DOUBLE)(cpu_cycles()); |
---|
| 55 | #endif |
---|
| 56 | |
---|
| 57 | return (q); |
---|
| 58 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.