]>
git.saurik.com Git - apple/xnu.git/blob - tools/tests/darwintests/gettimeofday_29192647.c
bd7b66159b44bc6bdfe2fb625218cf0530b730a2
5 #include <mach/mach_time.h>
8 #include <darwintest.h>
9 #include <darwintest_perf.h>
11 T_DECL(gettimeofday_tl
, "gettimeofday performance in tight loop") {
14 dt_stat_time_t s
= dt_stat_time_create("gettimeofday tight loop");
15 T_STAT_MEASURE_LOOP(s
){
16 gettimeofday(&time
, NULL
);
22 extern int __gettimeofday(struct timeval
*, struct timezone
*);
23 T_DECL(__gettimeofday_tl
, "__gettimeofday performance in tight loop") {
27 dt_stat_time_t s
= dt_stat_time_create("__gettimeofday tight loop");
28 T_STAT_MEASURE_LOOP(s
){
29 __gettimeofday(&time
, NULL
);
35 T_DECL(gettimeofday_sl
, "gettimeofday performance in loop with sleep") {
38 dt_stat_time_t s
= dt_stat_time_create("gettimeofday loop with sleep");
39 while (!dt_stat_stable(s
)) {
40 T_STAT_MEASURE_BATCH(s
){
41 gettimeofday(&time
, NULL
);