| version 1.7, 2002/10/05 21:16:43 |
version 1.8, 2003/01/05 10:44:07 |
|
|
| /* |
/* |
| * $Platon: rdtsc.c,v 1.6 2002/10/02 20:13:58 nepto Exp $ |
* $Platon: libplaton/platon/misc/rdtsc.c,v 1.7 2002/10/05 21:16:43 nepto Exp $ |
| */ |
*/ |
| |
|
| #include <stdio.h> |
#include <stdio.h> |
| #include <time.h> |
#include <time.h> |
| |
|
| #include <platon/misc/rdtsc.h> |
#include <rdtsc.h> |
| |
|
| #if defined SELF || defined SEFTEST || defined SELF_RDTSC |
#if defined SELF || defined SEFTEST || defined SELF_RDTSC |
| |
|
| Line 16 int main(int argc, char **argv) |
|
| Line 16 int main(int argc, char **argv) |
|
| double result_max; |
double result_max; |
| double result_avg; |
double result_avg; |
| |
|
| rdtsc_min(time(NULL), 500000, result_min); |
rdtsc_min(time(NULL);, 500000, result_min); |
| rdtsc_avg(time(NULL), 500000, result_avg); |
rdtsc_avg(time(NULL);, 500000, result_avg); |
| rdtsc_max(time(NULL), 500000, result_max); |
rdtsc_max(time(NULL);, 500000, result_max); |
| |
|
| printf( "time(NULL): min:%g\n" |
printf( "time(NULL): min:%g\n" |
| "time(NULL): max:%g\n" |
"time(NULL): max:%g\n" |
| Line 28 int main(int argc, char **argv) |
|
| Line 28 int main(int argc, char **argv) |
|
| result_avg); |
result_avg); |
| |
|
| /* the same test in another order */ |
/* the same test in another order */ |
| rdtsc_min(time(NULL), 500000, result_min); |
rdtsc_min(time(NULL);, 500000, result_min); |
| rdtsc_max(time(NULL), 500000, result_max); |
rdtsc_max(time(NULL);, 500000, result_max); |
| rdtsc_avg(time(NULL), 500000, result_avg); |
rdtsc_avg(time(NULL);, 500000, result_avg); |
| |
|
| printf( "time(NULL): min:%g\n" |
printf( "time(NULL): min:%g\n" |
| "time(NULL): max:%g\n" |
"time(NULL): max:%g\n" |