projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] File creation and info fixes
[fio.git]
/
time.c
diff --git
a/time.c
b/time.c
index 52462633a5fccc3791105aef65f64e708001c7f7..ad5ee3fe51773c9019067f593834428afad8fc9b 100644
(file)
--- a/
time.c
+++ b/
time.c
@@
-3,6
+3,8
@@
#include "fio.h"
#include "fio.h"
+static struct timeval genesis;
+
unsigned long utime_since(struct timeval *s, struct timeval *e)
{
double sec, usec;
unsigned long utime_since(struct timeval *s, struct timeval *e)
{
double sec, usec;
@@
-60,7
+62,7
@@
unsigned long time_since_now(struct timeval *s)
/*
* busy looping version for the last few usec
*/
/*
* busy looping version for the last few usec
*/
-
static
void __usec_sleep(unsigned int usec)
+void __usec_sleep(unsigned int usec)
{
struct timeval start;
{
struct timeval start;
@@
-120,3
+122,13
@@
void rate_throttle(struct thread_data *td, unsigned long time_spent,
td->rate_pending_usleep -= overtime;
}
}
td->rate_pending_usleep -= overtime;
}
}
+
+unsigned long mtime_since_genesis(void)
+{
+ return mtime_since_now(&genesis);
+}
+
+void time_init(void)
+{
+ gettimeofday(&genesis, NULL);
+}