| 980 | } |
| 981 | |
| 982 | double snprintfTime() |
| 983 | { |
| 984 | struct timespec now; |
| 985 | int count = 1000000; |
| 986 | char buffer[1000]; |
| 987 | |
| 988 | clock_gettime(CLOCK_REALTIME, &now); |
| 989 | uint64_t start = Cycles::rdtsc(); |
| 990 | Util::serialize(); |
| 991 | for (int i = 0; i < count; ++i) { |
| 992 | snprintf(buffer, 1000, "%010lu.%09lu", now.tv_sec, now.tv_nsec); |
| 993 | } |
| 994 | Util::serialize(); |
| 995 | uint64_t stop = Cycles::rdtsc(); |
| 996 | |
| 997 | return Cycles::toSeconds(stop - start)/count; |
| 998 | } |
| 999 | |
| 1000 | double snprintStatic100Char() |
| 1001 | { |