Files
c3c/src/compiler_tests/benchmark.c
2019-12-11 17:22:48 +01:00

17 lines
364 B
C

// Copyright (c) 2019 Christoffer Lerno. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "benchmark.h"
#include <time.h>
static int begin = 0;
void bench_begin(void)
{
begin = clock();
}
double bench_mark(void)
{
return (double)(clock() - begin) / (double)CLOCKS_PER_SEC;
}