diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2013-10-27 13:17:24 +0000 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2013-10-27 13:17:24 +0000 |
| commit | b0df6d36f11be07a46bce904489624e530d8618c (patch) | |
| tree | 74c4f2491be9378f5a719be404443891d6865c80 | |
| parent | 15a9dcc5906882478a0328552acb0403d0625673 (diff) | |
BUGFIX:
1. Timing function update.
| -rw-r--r-- | demos/generic/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/demos/generic/main.c b/demos/generic/main.c index 085b2ed..9bcf80d 100644 --- a/demos/generic/main.c +++ b/demos/generic/main.c @@ -33,11 +33,16 @@ #include <getopt.h>
#include <stdbool.h>
#include <time.h>
+#include <unistd.h>
#include <ext4_filedev.h>
#include <io_raw.h>
#include <ext4.h>
+#ifdef WIN32
+#include <windows.h>
+#endif
+
/**@brief Input stream name.*/
char input_name[128] = "ext2";
@@ -202,7 +207,9 @@ static void block_stats(void) static clock_t get_ms(void)
{
- return (clock() * 1000) / (CLOCKS_PER_SEC);
+ struct timeval t;
+ gettimeofday(&t);
+ return (t.tv_sec * 1000) + (t.tv_usec / 1000);
}
static bool dir_test(int len)
|
