]>
git.saurik.com Git - apple/xnu.git/blob - tests/gettimeofday_29192647.c
5 #include <mach/mach_time.h>
8 #include <darwintest.h>
9 #include <darwintest_perf.h>
11 T_GLOBAL_META(T_META_TAG_PERF
);
13 T_DECL(gettimeofday_tl
, "gettimeofday performance in tight loop") {
16 dt_stat_time_t s
= dt_stat_time_create("gettimeofday tight loop");
17 T_STAT_MEASURE_LOOP(s
){
18 gettimeofday(&time
, NULL
);
24 extern int __gettimeofday(struct timeval
*, struct timezone
*);
25 T_DECL(__gettimeofday_tl
, "__gettimeofday performance in tight loop") {
29 dt_stat_time_t s
= dt_stat_time_create("__gettimeofday tight loop");
30 T_STAT_MEASURE_LOOP(s
){
31 __gettimeofday(&time
, NULL
);
37 T_DECL(gettimeofday_sl
, "gettimeofday performance in loop with sleep") {
40 dt_stat_time_t s
= dt_stat_time_create("gettimeofday loop with sleep");
41 while (!dt_stat_stable(s
)) {
42 T_STAT_MEASURE_BATCH(s
){
43 gettimeofday(&time
, NULL
);