diff options
author | vanhauser-thc <vh@thc.org> | 2024-02-08 15:13:46 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2024-02-08 15:13:46 +0100 |
commit | 369fce9c85bf3b850a7109e4604fee71f694d2cb (patch) | |
tree | 2d3e61ebf00bd73958aaeb45072515837a026b68 /utils/bench/hash.c | |
parent | eaf4a29930fb5a397716cb34db71f1f14530923a (diff) | |
download | afl++-369fce9c85bf3b850a7109e4604fee71f694d2cb.tar.gz |
code format
Diffstat (limited to 'utils/bench/hash.c')
-rw-r--r-- | utils/bench/hash.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/utils/bench/hash.c b/utils/bench/hash.c index 013a5321..d4be0ab4 100644 --- a/utils/bench/hash.c +++ b/utils/bench/hash.c @@ -13,30 +13,41 @@ #undef XXH_INLINE_ALL int main() { - char *data = malloc(4097); + + char *data = malloc(4097); struct timespec start, end; - long long duration; - int i; - uint64_t res; + long long duration; + int i; + uint64_t res; clock_gettime(CLOCK_MONOTONIC, &start); for (i = 0; i < 100000000; ++i) { - res = XXH3_64bits(data, 4097); - memcpy(data + 16, (char*)&res, 8); + + res = XXH3_64bits(data, 4097); + memcpy(data + 16, (char *)&res, 8); + } + clock_gettime(CLOCK_MONOTONIC, &end); - duration = (end.tv_sec - start.tv_sec) * 1000000000LL + (end.tv_nsec - start.tv_nsec); + duration = (end.tv_sec - start.tv_sec) * 1000000000LL + + (end.tv_nsec - start.tv_nsec); printf("xxh3 duration: %lld ns\n", duration); memset(data, 0, 4097); clock_gettime(CLOCK_MONOTONIC, &start); for (i = 0; i < 100000000; ++i) { - res = t1ha0_ia32aes(data, 4097); - memcpy(data + 16, (char*)&res, 8); + + res = t1ha0_ia32aes(data, 4097); + memcpy(data + 16, (char *)&res, 8); + } + clock_gettime(CLOCK_MONOTONIC, &end); - duration = (end.tv_sec - start.tv_sec) * 1000000000LL + (end.tv_nsec - start.tv_nsec); + duration = (end.tv_sec - start.tv_sec) * 1000000000LL + + (end.tv_nsec - start.tv_nsec); printf("t1ha0_ia32aes duration: %lld ns\n", duration); return 0; + } + |