Prev Next

Returns Elapsed Number of Seconds

Syntax
s = elapsed_seconds()

Purpose
This routine is accurate to within .02 seconds (see elapsed_seconds.cpp ). It does not necessary work for time intervals that are greater than a day.
  1. If running under the Microsoft compiler, it uses ::GetSystemTime for timing.
  2. Otherwise, if gettimeofday is available, it is used.
  3. Otherwise, std::clock() is used.


s
is a double equal to the number of seconds since the first call to elapsed_seconds.

Microsoft Systems
It you are using the Microsoft C++ compiler, you will need to link in the external routine called microsoft_timer .

Example
The routine elapsed_seconds.cpp is an example and test of this routine.
Input File: cppad/elapsed_seconds.hpp