mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-21 10:22:30 +03:00
Add a simple timer implementation for use in benchmarking.
This commit is contained in:
parent
82e88d1ecf
commit
b67ec3c497
4 changed files with 75 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
|
|
@ -136,6 +137,7 @@
|
|||
#include "test/mtx.h"
|
||||
#include "test/mq.h"
|
||||
#include "test/test.h"
|
||||
#include "test/timer.h"
|
||||
#include "test/thd.h"
|
||||
#define MEXP 19937
|
||||
#include "test/SFMT.h"
|
||||
|
|
|
|||
15
test/include/test/timer.h
Normal file
15
test/include/test/timer.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Simple timer, for use in benchmark reporting.
|
||||
*/
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
typedef struct {
|
||||
struct timeval tv0;
|
||||
struct timeval tv1;
|
||||
} timer_t;
|
||||
|
||||
void timer_start(timer_t *timer);
|
||||
void timer_stop(timer_t *timer);
|
||||
uint64_t timer_usec(const timer_t *timer);
|
||||
void timer_ratio(timer_t *a, timer_t *b, char *buf, size_t buflen);
|
||||
Loading…
Add table
Add a link
Reference in a new issue