Commit ec21a925 authored by unknown's avatar unknown

Fixed problem in my_micro_time_and_time().

parent 8160075c
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
/* thus to get the current time we should use the system function /* thus to get the current time we should use the system function
with the highest possible resolution */ 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 "mysys_priv.h"
#include "my_static.h" #include "my_static.h"
...@@ -113,7 +118,7 @@ ulonglong my_micro_time() ...@@ -113,7 +118,7 @@ ulonglong my_micro_time()
query_performance_frequency)); query_performance_frequency));
} }
else else
newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */ newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec */
return newtime; return newtime;
#elif defined(HAVE_GETHRTIME) #elif defined(HAVE_GETHRTIME)
return gethrtime()/1000; return gethrtime()/1000;
...@@ -161,7 +166,9 @@ ulonglong my_micro_time_and_time(time_t *time_arg) ...@@ -161,7 +166,9 @@ ulonglong my_micro_time_and_time(time_t *time_arg)
if (query_performance_frequency) if (query_performance_frequency)
{ {
QueryPerformanceCounter((LARGE_INTEGER*) &newtime); QueryPerformanceCounter((LARGE_INTEGER*) &newtime);
newtime/= (query_performance_frequency * 1000000); return ((newtime / query_performance_frequency * 10000000) +
(newtime % query_performance_frequency * 10000000 /
query_performance_frequency));
} }
else else
newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec. */ newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec. */
......
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