seconds()

This function returns the number of seconds since the program started.

Example

#include <Plaquette.h>

DigitalOut led(13, SOURCE);

void begin() {
  led.off();
}

void step() {
  // Switch the LED on after 10 seconds.
  if (seconds() > 10)
    led.on();
}

Reference

float pq::seconds(bool referenceTime = true)

Returns time in seconds.

Optional parameter allows to ask for reference time (default) which will yield the same value through one iteration of step(), or “real” time which Will return the current total running time.

Parameters:

referenceTime – determines whether the function returns the reference time or the real time

Returns:

the time in seconds

See Also