Make use of modern standard types
Summary: stdint.h defines the modern standard c types which have a fixed memory size. This makes the program run more predictably as well as removing the need to ugly double work types such as `unsigned int` or `long long`. Reviewed By: lucasr Differential Revision: D3649096 fbshipit-source-id: dc9fc8861c3106494c5d00d6ac337da50a4c945b
This commit is contained in:
committed by
Facebook Github Bot 7
parent
c72321f8a9
commit
c7d02257e3
@@ -10,9 +10,10 @@
|
||||
#ifndef __CSS_BENCHMARK_H
|
||||
#define __CSS_BENCHMARK_H
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#define NUM_REPETITIONS 100000
|
||||
|
||||
@@ -28,7 +29,7 @@ int main(int argc, char const *argv[]) { \
|
||||
|
||||
#define CSS_BENCHMARK(NAME, BLOCK) \
|
||||
__start = clock(); \
|
||||
for (int __i = 0; __i < NUM_REPETITIONS; __i++) { BLOCK } \
|
||||
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { BLOCK } \
|
||||
__end = clock(); \
|
||||
__printBenchmarkResult(NAME, __start, __end);
|
||||
|
||||
|
Reference in New Issue
Block a user