test: gettickc.c File Reference

Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# gettickc.c File Reference

`#include "exp.h"`

Go to the source code of this file.

## Functions

ULONG | NtGetTickCount (VOID)

## Function Documentation

ULONG NtGetTickCount | ( | VOID |  | ) |

Definition at line 26 of file gettickc.c.

References ExpTickCountMultiplier, and KeTickCount.

Referenced by AnimateFade(), DispatchMessageWorker(), DoCallback(), FHungApp(), MNAnimate(), MonitorConv(), MonitorLink(), MonitorStringHandle(), MonotonicTick(), PeekMessage(), PostMove(), ProcessMouseInput(), RtlpGet64BitTickCount(), RtlpInitializeTimerThreadPool(), RtlpStartIOWorkerThread(), RtlpStartWorkerThread(), RtlpWaitThread(), RtlQueueWorkItem(), SetLastDDEMLError(), StartFade(), StoreMessage(), StoreQMessage(), TimersProc(), TooltipAnimate(), VdmTraceEvent(), xxxActivateThisWindow(), xxxAnimateCaption(), xxxCallJournalPlaybackHook(), xxxDispatchMessage(), xxxHungAppDemon(), xxxInterSendMsgEx(), xxxMenuWindowProc(), xxxMessageEvent(), xxxMKButtonSetState(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), xxxMouseEventDirect(), xxxPollAndWaitForSingleObject(), xxxProcessKeyEvent(), xxxPushKeyEvent(), xxxRemoteStopScreenUpdates(), xxxSimulateShiftF10(), xxxSystemParametersInfo(), xxxTooltipWndProc(), xxxUserPowerStateCalloutWorker(), xxxWindowEvent(), zzzAnimateCursor(), zzzCalcStartCursorHide(), zzzSetCursorPos(), and zzzUpdateCursorImage().

    00032                    :
    00033
    00034     This function computes the number of milliseconds since the system
    00035     was booted. The computation is performed by multiplying the clock
    00036     interrupt count by a scaled fixed binary multiplier and then right
    00037     shifting the 64-bit result to extract the 32-bit millisecond count.
    00038
    00039     The multiplier fraction is scaled by 24 bits. Thus for a 100 Hz clock
    00040     rate, there are 10 ticks per millisecond, and the multiplier is
    00041     0x0a000000 (10 << 24). For a 128 Hz clock rate, there are 7.8125, or
    00042     7 13/16 ticks per millisecond, and so the multiplier is 0x07d00000.
    00043
    00044     This effectively replaces a (slow) divide instruction with a (fast)
    00045     multiply instruction. The multiplier value is only calculated once
    00046     based on the TimeIncrement value (clock tick interval in 100ns units).
    00047
    00048     N.B. The tick count value wraps every 2^32 milliseconds (49.71 days).
    00049
    00050 Arguments:
    00051
    00052     None.
    00053
    00054 Return Value:
    00055
    00056     The number of milliseconds since the system was booted is returned
    00057     as the function value.
    00058
    00059 --*/
    00060
    00061 {
    00062     ULONGLONG Product;
    00063
    00064     //
    00065     // compute unsigned 64-bit product
    00066     //
    00067
    00068     Product = (ULONGLONG)KeTickCount * ExpTickCountMultiplier;
    00069
    00070     //
    00071     // shift off 24-bit fraction part and
    00072     // return the 32-bit canonical ULONG integer part.
    00073     //
    00074
    00075     return ((ULONG)(Product >> 24));
    00076 }