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.


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