It means that the granualarity of the clock is not sufficient to *detect* a
change. Even though the unit of time returned in measured in milliseconds,
it really is system dependent on what the granularity of the timer is. For
example, a common Win32 API, GetTickCount(), returns time in units of
milliseconds, but it can have a granularity of 10msec, meaning up to 10msec
may have to pass before a new value is returned. Milliseconds on the other
hand, are just units. It could be in microseconds, it wouldn't matter: if
the clock changes every 10,000 microseconds, then you aren't any better off.

IOQuake3 runs of a variety of platforms, and for their purposes, it was
sufficient. If you're time a loop by repeating an operation (i.e.
benchmarking), then maybe you can try increasing the number iterations?
Otherwise, celebrate! The code is "fast enough"!

But, if you really must have access to a higher resolution timer, you'll
need to go OS-specific. If you're using a POSIX-like system,
clock_gettime() may be able to help. On Windows, there is
QueryPerformanceCounter().


Patrick

On Thu, Sep 20, 2012 at 10:03 PM, Yasir I. Al-Dosary - zgzg2020™ <
yasiraldos...@yahoo.com> wrote:

> Hi,
> I am trying to measure how much processing time certain functions take.
> --------
>     StartTime = Sys_Milliseconds();
>     for(loops more than 20 times) {
>     FuncX(Var0);
>     }
>     EndTime = Sys_Milliseconds() - StartTime;
> ---------
> EndTime gets a zero value many times.
> How can this be correct?
> Is there a higher precision time built-in function inside ioquake3?
>
> Cheers
>
> _______________________________________________
> ioquake3 mailing list
> ioquake3@lists.ioquake.org
> http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
> By sending this message I agree to love ioquake3 and libsdl.
>
_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to