summaryrefslogtreecommitdiff
path: root/examples/timings.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/timings.c')
-rw-r--r--examples/timings.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/timings.c b/examples/timings.c
index 6c85da0f..f7537a73 100644
--- a/examples/timings.c
+++ b/examples/timings.c
@@ -412,6 +412,26 @@ main (int argc, char *argv [])
(long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT);
+
+ getrusage (RUSAGE_SELF, &rusage_start);
+
+ for (c = 0; c < PROFILE_COUNT; c++)
+ glibtop_get_proc_diskio (&data.proc_diskio, pid);
+
+ getrusage (RUSAGE_SELF, &rusage_end);
+
+ libgtop_timersub (&rusage_end.ru_utime, &rusage_start.ru_utime,
+ &elapsed_utime);
+
+ libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
+ &elapsed_stime);
+
+ printf ("Proc_DiskIo (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
+ (unsigned long) data.proc_diskio.flags, PROFILE_COUNT,
+ (long double) ELAPSED_UTIME / PROFILE_COUNT,
+ (long double) ELAPSED_STIME / PROFILE_COUNT);
+
+
getrusage (RUSAGE_SELF, &total_end);
libgtop_timersub (&total_end.ru_utime, &total_start.ru_utime,