Date: Wed, 17 Jul 2002 12:26:34 -0700 From: Deepankar Das <deepankar.das@panasas.com> To: Andrei Cojocaru <spinlock_lists@empirequest.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Counting the clock cycles Message-ID: <3D35C4EA.3050408@panasas.com> References: <00d501c22dc4$57d08b00$0200a8c0@twothousand>
next in thread | previous in thread | raw e-mail | index | archive | help
rdtsc() will give you cycle counts since system boot. It reads a Pentium internal register which is incremented at every CPU internal clock cycle. Deepankar Andrei Cojocaru wrote: > I was asking around in #freebsdhelp on EFNet what the equivalent of > GetTickCount() in the Win32 API is in FreeBSD. > > I need a way to properly determine passage of time that is not affected if I > change the system clock for example. The only way I'm aware that you can do > that is by counting the number of clock cycles since system startup. What > function does that in FreeBSD? I'd also like a Linux way if possible. (that > is a way that will work across all UNIX clones). Thanks and please include > my email in the reply directly since I'm not signed up to this mailing list. > Thanks once again. > ---- > Andrei Cojocaru > spinlock_lists@empirequest.com > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D35C4EA.3050408>