Re: timer question

From: Chris Friesen (cfriesen_at_nortelnetworks.com)
Date: 04/01/04

  • Next message: Albert Cahalan: "[PATCH] multiple namespaces"
    Date:	Thu, 01 Apr 2004 01:10:00 -0500
    To: root@chaos.analogic.com
    
    

    Richard B. Johnson wrote:
    > On Wed, 31 Mar 2004, Chuck Lever wrote:
    >
    >
    >>hi all-
    >>
    >>i'm looking for a way to do microsecond resolution timing in the RPC
    >>client. i need a timer or timestamp function that is fairly cheap, that i
    >>can call on any hardware platform, and that i can invoke from inside a
    >>bottom half.
    >>
    >>any suggestions?

    As *** Johnson said, x86 has rdtsc. PowerPC has the mftbr, which is
    equivalent. MIPS has something similar.

    Many architectures have something, but currently it has to be coded for
    each.

    One thing that might be nice would be a common API to get a high-res
    timestamp, something like a 64-bit nano_uptime, which would be good for
    uptimes of up to 524 years at nanosecond precision. Or else you could
    just use timespec, although its not as nice on actual 64-bit machines.

    Chris

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Albert Cahalan: "[PATCH] multiple namespaces"