Add and run clang format script

Summary: This code used to be auto generated. Let's let clang-format clean up some stuff for us.

Reviewed By: lucasr

Differential Revision: D3662225

fbshipit-source-id: ddd4064cbf9be21ca6a97001ace1b56b4314c86f
This commit is contained in:
Emil Sjolander
2016-08-04 08:20:11 -07:00
committed by Facebook Github Bot 9
parent 9278ff462e
commit efe1595f0e
9 changed files with 680 additions and 541 deletions

View File

@@ -16,24 +16,24 @@
#define NUM_REPETITIONS 100000
#define CSS_BENCHMARKS(BLOCK) \
int main(int argc, char const *argv[]) { \
clock_t __start; \
clock_t __end; \
{ \
BLOCK \
} \
return 0; \
}
#define CSS_BENCHMARKS(BLOCK) \
int main(int argc, char const *argv[]) { \
clock_t __start; \
clock_t __end; \
{ BLOCK } \
return 0; \
}
#define CSS_BENCHMARK(NAME, BLOCK) \
__start = clock(); \
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { BLOCK } \
__end = clock(); \
__printBenchmarkResult(NAME, __start, __end);
#define CSS_BENCHMARK(NAME, BLOCK) \
__start = clock(); \
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
BLOCK \
} \
__end = clock(); \
__printBenchmarkResult(NAME, __start, __end);
void __printBenchmarkResult(char *name, clock_t start, clock_t end) {
float total = (end - start) / (double) CLOCKS_PER_SEC * 1000;
float total = (end - start) / (double)CLOCKS_PER_SEC * 1000;
float mean = total / NUM_REPETITIONS;
printf("%s: ", name);
printf("%lf ms", mean);