diff options
author | unknown <jani@hynda.mysql.fi> | 2007-11-08 13:25:26 +0200 |
---|---|---|
committer | unknown <jani@hynda.mysql.fi> | 2007-11-08 13:25:26 +0200 |
commit | 859b6339b07adb399a2bccc41a1dbf32a98a8973 (patch) | |
tree | e70d877c97b943e4ad2173acf2cdd36c3543918f /mysys/my_getsystime.c | |
parent | 0eec2d63d5fbe531e48ac507b8889194a358bd33 (diff) | |
download | mariadb-git-859b6339b07adb399a2bccc41a1dbf32a98a8973.tar.gz |
Fixed problem in my_micro_time_and_time().
Diffstat (limited to 'mysys/my_getsystime.c')
-rw-r--r-- | mysys/my_getsystime.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c index 759e0d302a7..4fdd979f4bb 100644 --- a/mysys/my_getsystime.c +++ b/mysys/my_getsystime.c @@ -17,6 +17,11 @@ /* thus to get the current time we should use the system function with the highest possible resolution */ +/* + TODO: in functions my_micro_time() and my_micro_time_and_time() there + exists some common code that should be merged into a function. +*/ + #include "mysys_priv.h" #include "my_static.h" @@ -113,7 +118,7 @@ ulonglong my_micro_time() query_performance_frequency)); } else - newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */ + newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec */ return newtime; #elif defined(HAVE_GETHRTIME) return gethrtime()/1000; @@ -161,7 +166,9 @@ ulonglong my_micro_time_and_time(time_t *time_arg) if (query_performance_frequency) { QueryPerformanceCounter((LARGE_INTEGER*) &newtime); - newtime/= (query_performance_frequency * 1000000); + return ((newtime / query_performance_frequency * 10000000) + + (newtime % query_performance_frequency * 10000000 / + query_performance_frequency)); } else newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec. */ |