diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2012-06-09 08:23:55 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2012-06-09 08:23:55 +0000 |
| commit | ff0f80e1fad2afbc18d0346e0d4e42ec8dad6cc6 (patch) | |
| tree | 902c37640f31bee768c47a676f3c7b8909e14c47 /tools | |
| parent | 4d993fcf5bd9124664bf3805c82108c1c31e1a6a (diff) | |
Notes
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/tools/syscall_timing/syscall_timing.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/tools/syscall_timing/syscall_timing.c b/tools/tools/syscall_timing/syscall_timing.c index 2fb2add241fd..756fec90aeba 100644 --- a/tools/tools/syscall_timing/syscall_timing.c +++ b/tools/tools/syscall_timing/syscall_timing.c @@ -142,6 +142,22 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg, const char *path) } uintmax_t +test_gettimeofday(uintmax_t num, uintmax_t int_arg, const char *path) +{ + struct timeval tv; + uintmax_t i; + + benchmark_start(); + for (i = 0; i < num; i++) { + if (alarm_fired) + break; + (void)gettimeofday(&tv, NULL); + } + benchmark_stop(); + return (i); +} + +uintmax_t test_pipe(uintmax_t num, uintmax_t int_arg, const char *path) { int fd[2], i; @@ -608,6 +624,7 @@ static const struct test tests[] = { { "getuid", test_getuid }, { "getppid", test_getppid }, { "clock_gettime", test_clock_gettime }, + { "gettimeofday", test_gettimeofday }, { "pipe", test_pipe }, { "socket_local_stream", test_socket_stream, .t_int = PF_LOCAL }, { "socket_local_dgram", test_socket_dgram, .t_int = PF_LOCAL }, |
