Created
April 3, 2019 05:04
-
-
Save azat/2168ee8cc3a29397be63dcf9894f7075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <event2/event.h> | |
| #include <event2/util.h> | |
| #include <stdlib.h> | |
| int main(int argc, char **argv) | |
| { | |
| struct timeval tv; | |
| size_t n = argc == 2 ? atoll(argv[1]) : 1<<20; | |
| struct event_base *base = event_base_new(); | |
| for (size_t i = 0; i < n; ++i) { | |
| #ifdef CACHED | |
| event_base_gettimeofday_cached(base, &tv); | |
| #else | |
| evutil_gettimeofday(&tv, 0); | |
| #endif | |
| } | |
| return 0; | |
| } |
Author
azat
commented
Apr 3, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment