timing help for novice - Programmer

This is a discussion on timing help for novice - Programmer ; Help me , i am lost. I cannot find a function, that gets simple miliseconds. I know only GetTickCount(), but it returns 55ms steps. If you know any, please tell me what header needed to include and how it works. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: timing help for novice

  1. timing help for novice

    Help me , i am lost. I cannot find a function, that gets simple miliseconds.
    I know only GetTickCount(), but it returns 55ms steps. If you know any,
    please tell me what header needed to include and how it works.

    Bohus



  2. Re: timing help for novice

    Bohus Kral wrote:
    > Help me , i am lost. I cannot find a function, that gets simple miliseconds.
    > I know only GetTickCount(), but it returns 55ms steps. If you know any,
    > please tell me what header needed to include and how it works.
    >
    > Bohus
    >
    >


    GetTickCount() does return milliseconds. But the return value doesn't
    change every millisecond because the operating system code doesn't
    execute every millisecond.

    The only way you can get a timer that changes every time you call it is
    QueryPerformanceCounter(). It reads a hardware counter. It does not
    return milliseconds, but something close to microseconds.

    --
    Scott McPhillips [VC++ MVP]


+ Reply to Thread