71 lines
786 B
C
71 lines
786 B
C
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <graph.h>
|
|
|
|
|
|
#define CYCLE 1000000L
|
|
|
|
|
|
int main(void) {
|
|
|
|
unsigned long suivant;
|
|
|
|
/* int* time = NULL; */
|
|
|
|
/* time = malloc( sizeof(short int));
|
|
|
|
time[0] = 0;
|
|
time[1] = 0; */
|
|
|
|
|
|
suivant = Microsecondes() + CYCLE;
|
|
|
|
/*printf("%d : %d\n", &time[0],&time[1]);*/
|
|
|
|
while (1) {
|
|
|
|
if (Microsecondes() > suivant) {
|
|
|
|
|
|
|
|
/* une periode s'est écoulé */
|
|
/* prochaine date */
|
|
|
|
suivant = Microsecondes()+CYCLE;
|
|
|
|
/*time[1]++;
|
|
|
|
if ( time[1] == 60) {
|
|
|
|
time[1] = 0;
|
|
|
|
time[0] ++;
|
|
|
|
}*/
|
|
printf("%lu", Microsecondes());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/* if ( ToucheEnAttente() == 1 ) {
|
|
|
|
if (Touche() == XK_space) {
|
|
|
|
break;
|
|
|
|
}
|
|
}*/
|
|
|
|
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|