PIDUINO
Loading...
Searching...
No Matches
Piduino::Clock

Horloge. More...

#include <clock.h>

Collaboration diagram for Piduino::Clock:

Public Member Functions

 Clock ()
 Constructor.
 
virtual ~Clock ()
 Destructor.
 
unsigned long millis ()
 Number of milliseconds.
 
unsigned long micros ()
 Number of microseconds.
 

Static Public Member Functions

static void sleep (unsigned long s)
 Pauses for the amount of seconds.
 
static void delay (unsigned long ms)
 Pauses for the amount of milliseconds.
 
static void delayMicroseconds (unsigned long us)
 Pauses for the amount of microseconds.
 

Private Attributes

uint64_t _us
 
uint64_t _ms
 

Detailed Description

Horloge.

Author
Pascal JEAN
Date
03/05/18

Definition at line 39 of file clock.h.

Constructor & Destructor Documentation

◆ Clock()

Piduino::Clock::Clock ( )

Constructor.

His call is the origin of the times provided by the millis() and micros() functions.

◆ ~Clock()

virtual Piduino::Clock::~Clock ( )
virtual

Destructor.

Member Function Documentation

◆ delay()

static void Piduino::Clock::delay ( unsigned long  ms)
static

Pauses for the amount of milliseconds.

Pauses the thread for the amount of time (in milliseconds) specified as parameter.

Parameters
msthe number of milliseconds to pause, -1 deaden the thread until it is woken up by a signal

Referenced by sleep().

◆ delayMicroseconds()

static void Piduino::Clock::delayMicroseconds ( unsigned long  us)
static

Pauses for the amount of microseconds.

Pauses the thread for the amount of time (in microseconds) specified as parameter.
Depending on the value provided, this function can wait for a loop or alarm (for short values) or put the thread into the corresponding number of us.

Parameters
usthe number of milliseconds to pause, -1 deaden the thread until it is woken up by a signal

◆ micros()

unsigned long Piduino::Clock::micros ( )

Number of microseconds.

Returns the number of microseconds since began running the current program.

◆ millis()

unsigned long Piduino::Clock::millis ( )

Number of milliseconds.

Returns the number of milliseconds since began running the current program.

◆ sleep()

static void Piduino::Clock::sleep ( unsigned long  s)
inlinestatic

Pauses for the amount of seconds.

Pauses the thread for the amount of time (in seconds) specified as parameter.

Parameters
msthe number of seconds to pause, -1 deaden the thread until it is woken up by a signal

Definition at line 67 of file clock.h.

References delay().

Here is the call graph for this function:

Member Data Documentation

◆ _ms

uint64_t Piduino::Clock::_ms
private

Definition at line 115 of file clock.h.

◆ _us

uint64_t Piduino::Clock::_us
private

Definition at line 114 of file clock.h.