diff options
Diffstat (limited to 'benchmarks/stream/second_cpu.c')
-rw-r--r-- | benchmarks/stream/second_cpu.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmarks/stream/second_cpu.c b/benchmarks/stream/second_cpu.c new file mode 100644 index 0000000..24bc4dc --- /dev/null +++ b/benchmarks/stream/second_cpu.c @@ -0,0 +1,15 @@ +#include <sys/param.h> +#include <sys/types.h> +#include <sys/times.h> +#include <time.h> + +double second() +{ + long sec; + double secx; + struct tms realbuf; + + times(&realbuf); + secx = ( realbuf.tms_stime + realbuf.tms_utime ) / (float) CLK_TCK; + return ((double) secx); +} |