Rev | Line | |
---|
[5] | 1 | #include <sys/times.h> |
---|
| 2 | #include <sys/time.h> |
---|
| 3 | #include <time.h> |
---|
| 4 | #include <stdlib.h> |
---|
| 5 | #include "clocks.h" |
---|
| 6 | #include <unistd.h> |
---|
| 7 | double cputime() /* aix, xlf */ |
---|
| 8 | { struct tms b; |
---|
| 9 | clock_t r; |
---|
| 10 | times( &b); |
---|
| 11 | r = b.tms_utime + b.tms_stime; |
---|
| 12 | return ( (double) r/(double) sysconf(_SC_CLK_TCK)); |
---|
| 13 | } |
---|
| 14 | double CPUTIME() /* cray */ |
---|
| 15 | { |
---|
| 16 | return ( cputime()); |
---|
| 17 | } |
---|
| 18 | double cputime_() /* g77, gcc */ |
---|
| 19 | { |
---|
| 20 | return ( cputime()); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | double wallclock() |
---|
| 24 | { |
---|
| 25 | struct timeval toot; |
---|
| 26 | double r; |
---|
| 27 | |
---|
| 28 | gettimeofday(&toot,0); |
---|
| 29 | r=toot.tv_sec+0.000001*(double)toot.tv_usec; |
---|
| 30 | return(r); |
---|
| 31 | } |
---|
| 32 | double WALLCLOCK() |
---|
| 33 | { |
---|
| 34 | return (wallclock()); |
---|
| 35 | } |
---|
| 36 | double wallclock_() |
---|
| 37 | { |
---|
| 38 | return wallclock(); |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | void fortransleep(int *i) |
---|
| 42 | { |
---|
| 43 | sleep(*i); |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | void FORTRANSLEEP(int *i) |
---|
| 47 | { |
---|
| 48 | sleep(*i); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | void fortransleep_(int *i) |
---|
| 52 | { |
---|
| 53 | sleep(*i); |
---|
| 54 | } |
---|
| 55 | |
---|
Note: See
TracBrowser
for help on using the repository browser.