delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/11/19:36:49

Date: Wed, 11 Jul 2001 19:35:36 -0400
Message-Id: <200107112335.TAA27394@envy.delorie.com>
X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT envy DOT delorie DOT com using -f
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <001301c10ac1$b193bda0$767a5a8f@neo>
(dway AT designer DOT mailbr DOT com DOT br)
Subject: Re: getting the time elapsed
References: <200107061715 DOT NAA25775 AT delorie DOT com> <20010711090028 DOT A6188 AT kendall DOT sfbr DOT org> <ihvoktctpagnchmrapgtkd4jrgq3aki2uo AT 4ax DOT com> <001301c10ac1$b193bda0$767a5a8f AT neo>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> i want to know how to get the time elapsed, accurate (int float point)

Try uclock(), which is accurate to about a microsecond.

But, some version of Windows mess with the timer, making that less
accurate.  In those cases, try just clock(), which is accurate to
about 55 milliseconds.

For longer intervals, use gettimeofday() or time(), which measure
"wall clock time".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019