#include <stdio.h>
#include <time.h>
int minhafuncao(){
int x = 0;
x++;
return x;
}
int main () {
clock_t begin, end;
double time_spent;
int x;
for (int i = 0; i < 300000000; i++);
time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
printf ("Tempo gasto %.2lf segundos.\n", time_spent
);
for (int i = 0; i < 300000000; i++) minhafuncao();
time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
printf ("Tempo gasto %.2lf segundos.\n", time_spent
);
for (int i = 0; i < 300000000; i++) x++;
time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
printf ("Tempo gasto %.2lf segundos.\n", time_spent
); x++;
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDx0aW1lLmg+CgppbnQgbWluaGFmdW5jYW8oKXsKICAgIGludCB4ID0gMDsKICAgIHgrKzsKICAgIHJldHVybiB4Owp9CgppbnQgbWFpbiAoKSB7CiAgICBjbG9ja190IGJlZ2luLCBlbmQ7CiAgICBkb3VibGUgdGltZV9zcGVudDsKICAgIGludCB4OwoKICAgIGJlZ2luID0gY2xvY2soKTsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMzAwMDAwMDAwOyBpKyspOwogICAgZW5kID0gY2xvY2soKTsKICAgIHRpbWVfc3BlbnQgPSAoZG91YmxlKShlbmQgLSBiZWdpbikgLyBDTE9DS1NfUEVSX1NFQzsKICAgIHByaW50ZiAoIlRlbXBvIGdhc3RvICUuMmxmIHNlZ3VuZG9zLlxuIiwgdGltZV9zcGVudCk7CgogICAgYmVnaW4gPSBjbG9jaygpOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAzMDAwMDAwMDA7IGkrKykgbWluaGFmdW5jYW8oKTsKICAgIGVuZCA9IGNsb2NrKCk7CiAgICB0aW1lX3NwZW50ID0gKGRvdWJsZSkoZW5kIC0gYmVnaW4pIC8gQ0xPQ0tTX1BFUl9TRUM7CiAgICBwcmludGYgKCJUZW1wbyBnYXN0byAlLjJsZiBzZWd1bmRvcy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