Commit c4ccc23c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 72878530
......@@ -10,7 +10,7 @@
#include <sys/mman.h>
// 12345678
#define NITER 100000
#define NITER 500000
// microtime returns current time as double
double microtime() {
......@@ -33,7 +33,7 @@ int main() {
size_t size;
double Tstart, Tend;
fd = open("/dev/shm/y.dat", O_RDWR);
fd = open("/dev/shm/y.dat", O_RDWR | O_CREAT | O_TRUNC, 0666);
if (fd == -1) {
perror("open");
abort();
......@@ -69,7 +69,7 @@ int main() {
}
Tend = microtime();
printf("T(pagefault): %.1f\t(%i)\n", (Tend - Tstart) / NITER, sum);
printf("T(pagefault): %.1f ns\t(%i)\n", (Tend - Tstart) * 1E9 / NITER, sum);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment