#include <stdio.h> #include <sys/time.h> int main (void) { long long int i; struct timeval t1, t2; double a=1234567890, b; gettimeofday (&t1, NULL); for (i=0; i<1000000000; i++) { a--; b = a; b /= 256 * 128; } gettimeofday (&t2, NULL); printf ("Sec --->%u\n", (unsigned int) (t2.tv_sec - t1.tv_sec)); printf ("Usec --->%u\n", (unsigned int) (t2.tv_usec > t1.tv_usec ? t2.tv_usec - t1.tv_usec : t1.tv_usec - t2.tv_usec)); return 0; } ********************************** > gcc -Wall test.c -o test > ./test Sec --->19 Usec --->139116 > ********************************** > gcc -Wall -O2 test.c -o test > ./test Sec --->0 Usec --->1 > Почему так?