Rozdiely pre libplaton/platon/misc/rdtsc.c medzi verziami 1.3 a 1.4
| verzia 1.3, 2002/07/19 09:29:30 |
verzia 1.4, 2002/07/31 00:49:36 |
|
|
| |
|
| #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) |
| { |
{ |
| printf("time(NULL): "); |
double result_min; |
| rdtsc(time(NULL), 1000, result_max); |
double result_max; |
| |
double 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 |
| |
|
| Riadok 24 int main(int argc, char **argv) |
|
| Riadok 48 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.sk> http://platon.sk/
|
|