This is the mail archive of the
mailing list for the systemtap project.
Re: using get_cycles() to get the real elapsed time
- From: Roland McGrath <roland at redhat dot com>
- To: fche at redhat dot com (Frank Ch. Eigler)
- Cc: Li Guanglei <guanglei at cn dot ibm dot com>, "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Sun, 6 Aug 2006 13:51:11 -0700 (PDT)
- Subject: Re: using get_cycles() to get the real elapsed time
sched_clock is used by the scheduler and POSIX CPU clocks/timers, which
have the same requirements of being accurate and cheap. It returns ns.
It can be called from interrupt level. Its implementation is already
hardware-specific and is get_cycles with appropriate adjustments or
something else with nice properties for the particular hardware.
I think this is in all likelihood the best interface to use, if the
hrtimer stuff is not.