Edited to post corrected function:

I have made a small code to measure speed of functions.

```
unsigned int chrono_id;
#define CHRONO(iterations,function) \
{\
chrono_id ++;\
\
Serial.print("Chrono ");\
Serial.print(chrono_id);\
Serial.print(" - "#function" - "#iterations" calls...\n");\
\
unsigned long time = micros();\
\
for (unsigned long i = 0; i < iterations; i++)\
{\
function;\
}\
\
time = micros()-time;\
Serial.print("Average (microseconds) : ");\
Serial.print((float)time/(float)iterations);\
Serial.print("\n\n");\
}
```

Example usage:

```
void setup()
{
Serial.begin(9600);
delay(1000);
CHRONO(100000, random(10));
CHRONO(100000, micros());
CHRONO(100000,
{
sqrt(pow(2, 32));
sin(cos(tan(123456789)));
});
}
```

Example output:

```
Chrono 1 - random(10) - 100000 calls...
Average (microseconds) : 140.21
Chrono 2 - micros() - 100000 calls...
Average (microseconds) : 3.97
Chrono 3 - { sqrt(pow(2, 32)); sin(cos(tan(123456789))); } - 100000 calls...
Average (microseconds) : 0.00
```

More iterations = more accurate result.

Oh and I know, it’s ugly, it isn’t a good practice…but couldn’t find a way to make it in a normal function