[lkml]   [2002]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Measure time
    On Wed, 8 May 2002, Serguei I. Ivantsov wrote:

    > Hello!
    > Is there any function for high precision time measuring.
    > time() returns only in second. I need nanoseconds.
    > --
    > Regards,
    > Serguei I. Ivantsov
    > GSC Game World

    gettimeofday() returns seconds/microseconds. If you need nanoseconds,
    you can read CPU clock cycles in Intel machines with (assembly) rdtsc
    instructions and convert, based upon the CPU clock.

    If you really need nanosecond resolution in code that may be
    interrupted or preempted at any time, you are in a world of hurt.
    I suggest you review the requirement. You may need a TMS320C30 or
    similar DSP standing alone.

    Dick Johnson

    Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).

    Windows-2000/Professional isn't.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:25    [W:0.024 / U:19.324 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site