sysTime - SeqAn API Documentation

# fn() sysTime
Returns the system time in seconds.

Defined in | <seqan/basic.h>
Signature | `double sysTime();`

## Return Values

`double` | A `double`, system time stamp in seconds. Types: nolink:double

## Detailed Description

In contrast to cpuTime, the system time corresponds to the wall clock time under Linux and Mac OS X. Under Windows sysTime returns the result of cpuTime.

Use this for benchmarking uner Linux and Mac Os X.

Calls `clock_gettime` under Linux and `gettimeofday` under Mac OS X.

### Examples

We can use sysTime to instrument our code for profiling/timing information quite robustly. The following demonstrates how the Function.sysTime is used in many SeqAn apps for collecting timing information.

    bool printTiming = true;

    // ...

    double startTime = sysTime();
    // Do some complex calculation.
    if (printTiming)
        std::cerr << "Some complex calculation too " << sysTime() - startTime << " s." << std::endl;

## Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## See Also

- cpuTime

#### Dox Sources

    /*!
     * @fn sysTime
     *
     * @headerfile <seqan/basic.h>
     *
     * @brief Returns the system time in seconds.
     *
     * @signature double sysTime();
     *
     * @return double A <tt>double</tt>, system time stamp in seconds. Types:
     *                nolink:double
     *
     * In contrast to @link cpuTime @endlink, the system time corresponds to the
     * wall clock time under Linux and Mac OS X. Under Windows sysTime returns the
     * result of cpuTime.
     *
     * Use this for benchmarking uner Linux and Mac Os X.
     *
     * Calls <tt>clock_gettime</tt> under Linux and <tt>gettimeofday</tt> under Mac
     * OS X.
     *
     * @section Examples
     *
     * We can use sysTime to instrument our code for profiling/timing information
     * quite robustly. The following demonstrates how the Function.sysTime is used
     * in many SeqAn apps for collecting timing information.
     *
     * @code{.cpp}
     * bool printTiming = true;
     *
     * // ...
     *
     * double startTime = sysTime();
     * // Do some complex calculation.
     * if (printTiming)
     *     std::cerr << "Some complex calculation too " << sysTime() - startTime << " s." << std::endl;
     * @endcode
     *
     *
     * @see cpuTime
     */