Returns Elapsed Number of Seconds
Keywords: returns elapsed number seconds elapsed_seconds time syntax purpose s microsoft systems example

| Prev | Next |  |  |  |  |  |  |

Returns Elapsed Number of Seconds
Syntax
`# include <cppad/utility/elapsed_seconds.hpp>
` `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 the C++11 `std::chrono::high_resolution_clock` is available, it will be used for timing.
2. Otherwise, if running under the Microsoft compiler, `::GetSystemTime` will be used for timing.
3. Otherwise, if `gettimeofday` is available, it is used for timing.
4. Otherwise, `std::clock()` will be used for timing.

s
is a `double` equal to the number of seconds since the first call to `elapsed_seconds`.
Microsoft Systems
It you are using `::GetSystemTime`, 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/utility/elapsed_seconds.hpp