jack andrews skrev:
> #At file:///C:/w/repo/70/ based on
> revid:jack@stripped
>
> 2868 jack andrews 2009-04-15
> bug#44276 NdbTick assert() in Ndbif.cpp
>
> modified:
> storage/ndb/src/common/portlib/win32/NdbTick.c
> === modified file 'storage/ndb/src/common/portlib/win32/NdbTick.c'
> --- a/storage/ndb/src/common/portlib/win32/NdbTick.c 2008-10-02 09:41:59 +0000
> +++ b/storage/ndb/src/common/portlib/win32/NdbTick.c 2009-04-15 12:39:16 +0000
> @@ -15,6 +15,7 @@
>
> #include <ndb_global.h>
> #include "NdbTick.h"
> +#include <my_sys.h>
>
> void NdbTick_Init()
> {
> @@ -31,11 +32,14 @@ NDB_TICKS NdbTick_CurrentMillisecond(voi
> int
> NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
> {
> - LARGE_INTEGER liCount, liFreq;
> - QueryPerformanceCounter(&liCount);
> - QueryPerformanceFrequency(&liFreq);
> - *secs = liCount.QuadPart / liFreq.QuadPart;
> - liCount.QuadPart -= *secs * liFreq.QuadPart;
> - *micros = (Uint32)((liCount.QuadPart*1000000) / liFreq.QuadPart);
Hi Jack,
I would prefer if you don't use mysys, but rather implement the function
directly in portlib.
> + ulonglong t=my_micro_time(),
> + ullsecs,
> + ullmicros;
> +
> + ullsecs=t/(1000*1000);
magnus: ^ remember to use correct coding style, in this case NDB's
> + ullmicros=t-ullsecs;
> + assert(ullmicros<MAX_UINT32);
> + *secs=ullsecs;
> + *micros=(Uint32)ullmicros;
> return 0;
> }
>
>
>
/ Magnus
> ------------------------------------------------------------------------
>
>