RE: Get Milliseconds from COleDataTimeSpan

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi

try 'GetTickCount()' to measure time in msec

Example:

DWORD t1 = GetTickCount();
...
... your code
...
DWORD t2 = GetTickCount();

DWORD dt = t2 - t1; // dt is in msec



"Thomas Schindler" wrote:

> Hello,
>
> I want to retrieve the Milliseconds from COleDataTimeSpan.
> Is this the correct way?
>
> SYSTEMTIME st; ::GetSystemTime(&st);
> COleDataTime t1(st);
> ...
> GetSystemTime(&st);
> COleDateTime t2(st);
> COleDateTimeSpan ts = t2- t1;
> double MilliSecSpan = ts.m_span - ts.GetTotalSeconds();
>
> Thanks, T.
>
.



Relevant Pages

  • Re: COM thread deadlock problem
    ... Since S manages inputs from the browser (ASP session), ... > DWORD Win2KWaitForMultipleObjectsWithMessageLoop(DWORD nCount, CONST ... > DWORD dwTickBefore = GetTickCount(); ... > // get a tick snapshot after we call DispatchMessage ...
    (microsoft.public.win32.programmer.ole)
  • Re: GetTickCount
    ... "GetTickCount" ... {$IFDEF TestingTimerWrap} ... TickBias: DWord; ... {$ENDIF} ...
    (borland.public.delphi.nativeapi)
  • Re: Letzte reboot Zeit
    ... Energiesparmodus und Ruhezustand müssen dabei ignoriert werden. ... GetTickCount() liefert einen DWORD zurück, und ist dadurch auf knapp 50 ... Die Funktion sollte ab Windows 2000 lauffähig sein. ...
    (microsoft.public.de.vc)
  • Re: GetTickCount Frage.
    ... DWORD m_dwLastEmpfangsBlock = GetTickCount() ... if- m_dwLastEmpfangsBlock> TIMEOUT) ... Wenn jetzt nach 49,x Tagen der Wert von GetTickCountnach 0 überläuft, passt ja meine Überwachung nicht mehr. ...
    (microsoft.public.de.vc)