Commit 9bac0b07 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

move get_tdiff to test.h. Refs #2434. [t:2434]

{{{
svn merge -c18257 https://svn.tokutek.com/tokudb/mysql.branches/3.1.0/tokudb/
}}}
.


git-svn-id: file:///svn/toku/tokudb@18638 c7de825b-a66e-492c-adef-691d508d4ae1
parent b4d376d9
......@@ -582,20 +582,6 @@ void toku_logger_trim_log_files (TOKULOGGER logger, BOOL trim_log_files)
logger->trim_log_files = trim_log_files;
}
double get_tdiff(void) {
static struct timeval prev={0,0};
if (prev.tv_sec==0) {
gettimeofday(&prev, 0);
return 0.0;
} else {
struct timeval now;
gettimeofday(&now, 0);
double diff = now.tv_sec - prev.tv_sec + 1e-6*(now.tv_usec - prev.tv_usec);
prev = now;
return diff;
}
}
int toku_logger_maybe_fsync (TOKULOGGER logger, LSN lsn, int do_fsync)
// Effect: If fsync is nonzero, then make sure that the log is flushed and synced at least up to lsn.
// Entry: Holds input lock. The log entry has already been written to the input buffer.
......
......@@ -210,6 +210,20 @@ random64(void) {
return ret;
}
static __attribute__((__unused__))
double get_tdiff(void) {
static struct timeval prev={0,0};
if (prev.tv_sec==0) {
gettimeofday(&prev, 0);
return 0.0;
} else {
struct timeval now;
gettimeofday(&now, 0);
double diff = now.tv_sec - prev.tv_sec + 1e-6*(now.tv_usec - prev.tv_usec);
prev = now;
return diff;
}
}
//Simulate as hard a crash as possible.
//Choices:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment