Purpose
Gives you the execution time of your code in microseconds.
When to use
Whenever you want to know the time that just took the void loop()
to be executed completely.
Where to use
In the void loop()
part of your .ino
file.
Since knowing the code execution time is rarely relevant in a match setting, this function will be rarely used, if ever, in the final version of your code. It is mostly used for debugging purposes.
This function requires the use of the following functions at some point of your .ino
file in order to work properly:
Returns
Returns the elapsed time, in microseconds (4μs resolution), between the last two calls of the CrcLib::Update()
function as an unsigned int
type.
Main prototype and parameters
static unsigned int Crc::CrcLib::GetDeltaTimeMicros()
The following parameters must be passed to the function for it to work properly:
No parameters needed.
Overloads
This function does not have any overloads. It can only be used as described by the main prototype.
Examples
More on this function
What’s the difference between the Serial.print() and Serial.prinln() native Arduino functions used in the example ?
This page is a good starting point to learn about the New Line character.
What is a time resolution?
The time resolution is the smallest time interval that can be measured. Here, the time returned by the function will always be a multiple of 4μs
Articles liés
-
CrcLib: programmes de base (Système CrcDuino System) —
Cette page présente les programmes élémentaires qui doivent être assimilés par tous les programmeurs qui ont entre leurs mains un CrcDuino.
Programme minimal
-
GetBatteryVoltage() {FR} (Système CrcDuino System) —
Objectif
Lire la différence de potentiel entre les bornes 12V et GND du terminal vert (le voltage de la batterie).
Quand l’utiliser
-
GetDeltaTimeMicros() {FR} (Système CrcDuino System) —
Objectif
Temps d’exécution depuis le dernier
CrcLib::Update()
en microsecondes.Quand l’utiliser
-
GetDeltaTimeMillis() {FR} (Système CrcDuino System) —
Objectif
Temps d’exécution depuis le dernier
CrcLib::Update()
en millisecondes.Quand l’utiliser
-
Initialize() {FR} (Système CrcDuino System) —
Objectif
Préparer le CRCduino pour le programme
CrcLib
Quand l’utiliser
-
Update() {FR} (Système CrcDuino System) —
Objectif
Exécute les tâches de routine de la
CrcLib
. Entre autres, permet au CRCduino de contrôler les indicateurs lumineux, le son et les servos et de communiquer avec le contrôleur.Quand l’utiliser
0 Comments