Diff for libplaton/platon/misc/rdtsc.c between version 1.2 and 1.3
| version 1.2, 2002/07/16 22:26:16 |
version 1.3, 2002/07/19 09:29:30 |
|
|
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| #include <time.h> |
#include <time.h> |
| |
#include <dirent.h> |
| #include "rdtsc.h" |
#include "rdtsc.h" |
| |
|
| #if defined SELF || defined SEFTEST || defined SELF_RDTSC |
#if defined SELF || defined SEFTEST || defined SELF_RDTSC |
|
|
| /* Function int main(int argc, char **argv) {{{ */ |
/* Function int main(int argc, char **argv) {{{ */ |
| int main(int argc, char **argv) |
int main(int argc, char **argv) |
| { |
{ |
| float result_min; |
printf("time(NULL): "); |
| float result_max; |
rdtsc(time(NULL), 1000, result_max); |
| float result_avg; |
|
| |
|
| rdtsc_min(time(NULL), 500000, result_min); |
|
| rdtsc_avg(time(NULL), 500000, result_avg); |
|
| rdtsc_max(time(NULL), 500000, result_max); |
|
| |
|
| printf( "time(NULL): min:%g\n" |
|
| "time(NULL): max:%g\n" |
|
| "time(NULL): avg:%g\n", |
|
| result_min, |
|
| result_max, |
|
| result_avg); |
|
| |
|
| /* the same test in another order */ |
|
| rdtsc_min(time(NULL), 500000, result_min); |
|
| rdtsc_max(time(NULL), 500000, result_max); |
|
| rdtsc_avg(time(NULL), 500000, result_avg); |
|
| |
|
| printf( "time(NULL): min:%g\n" |
|
| "time(NULL): max:%g\n" |
|
| "time(NULL): avg:%g\n", |
|
| result_min, |
|
| result_max, |
|
| result_avg); |
|
| |
|
| return 0; |
return 0; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| #endif |
#endif |
| |
|
| Line 48 int main(int argc, char **argv) |
|
| Line 24 int main(int argc, char **argv) |
|
| * vim:set ts=4: |
* vim:set ts=4: |
| * vim600:fdm=marker fdl=0 fdc=3: |
* vim600:fdm=marker fdl=0 fdc=3: |
| * }}} */ |
* }}} */ |
| |
|
Platon Group <platon@platon.org> http://platon.org/
|
|