Add gettimeofday() test.
MFC after: 3 days
This commit is contained in:
parent
c6aea9681a
commit
548194db7d
@ -141,6 +141,22 @@ test_clock_gettime(uintmax_t num, uintmax_t int_arg, const char *path)
|
||||
return (i);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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 },
|
||||
|
Loading…
x
Reference in New Issue
Block a user