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 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
Related articles
-
CrcLib Basic Programs (Système CrcDuino System) —
This page presents the most basic programs that should first be tried out by every program when first getting their hands on a CrcDuino.
Minimal program
-
GetBatteryVoltage() (Système CrcDuino System) —
Purpose
Read the potential difference between the 12V and GND green terminals (the board supply voltage).
When to use
-
GetDeltaTimeMicros() (Système CrcDuino System) —
Purpose
Gives you the execution time of your code in microseconds.
When to use
-
GetDeltaTimeMillis() (Système CrcDuino System) —
Purpose
Gives you the execution time of your code in milliseconds.
When to use
-
Initialize() (Système CrcDuino System) —
Purpose
Sets up the board to be able to run the
CrcLib
library properly.When to use
-
PrintControllerState() (Système CrcDuino System) —
Purpose
Print the received state of the controller attached to the CrcConnect.
When to use
-
PrintControllerState() {FR} (Système CrcDuino System) —
Purpose
Print the received state of the controller attached to the CrcConnect.
When to use
-
Timer (Système CrcDuino System) —
Purpose
Delay a task in time or make it repeat periodically without blocking the CrcDuino.
When to use
-
Timer {FR} (Système CrcDuino System) —
Purpose
Delay a task in time or make it repeat periodically without blocking the CrcDuino.
When to use
-
Update() (Système CrcDuino System) —
Purpose
Updates all
CrcLib
members and routines. This allows the CrcDuino to update its time, LEDs, buzzer, inputs, and any other continuous functionality like communicating with the CrcConnect module.When to use
0 Comments