https://github.com/CryptDB/cryptdb
Tip revision: 7678bc98d3054f1418371779c6d1050cd1a88b2e authored by Raluca Ada Popa on 04 January 2014, 01:31:06 UTC
small changes to readme
small changes to readme
Tip revision: 7678bc9
timer.hh
#pragma once
#include <sys/time.h>
class timer {
private:
timer(const timer &t); /* no reason to copy timer objects */
public:
timer() { lap(); }
uint64_t lap() { /* returns microseconds */
uint64_t t0 = start;
uint64_t t1 = cur_usec();
start = t1;
return t1 - t0;
}
private:
static uint64_t cur_usec() {
struct timeval tv;
gettimeofday(&tv, 0);
return ((uint64_t)tv.tv_sec) * 1000000 + tv.tv_usec;
}
uint64_t start;
};