It's as long as it needs to be. If you ask it to do more work, it's going to take more cycles. You can wrap your loop code into a timing harness, if you like. Convert:
void setup()
{
[glow]my old setup code here[/glow]
}
void loop()
{
[glow]my old loop code here[/glow]
}
into:
void loop()
{
long start = millis();
static long count = 10;
for (long i = count; i > 0; i--)
my_loop();
long end = millis();
Serial.print("Took ");
Serial.print(end - start);
Serial.print("ms to loop ");
Serial.print(count);
Serial.println(" times.");
count *= 2;
}
void setup()
{
Serial.begin(9600);
[glow]my old setup code here[/glow]
}
void my_loop()
{
[glow]my old loop code here[/glow]
}
You'll get timing studies on your loop.
Took 0ms to loop 10 times.
Took 0ms to loop 20 times.
Took 2ms to loop 40 times.
Took 5ms to loop 80 times.
Took 11ms to loop 160 times.
Took 22ms to loop 320 times.
Took 43ms to loop 640 times.
** :**
Run it long enough to be satisfied you're getting a good numerical result (like 1000ms or more). Then divide by the count, and you have the time taken by one loop() call.