Création d'une fonction wait()
- La fonction wait() permet de mettre en pause le fonctionnement du programme.
This commit is contained in:
parent
0fa6963037
commit
25884773d6
@ -8,4 +8,6 @@ unsigned long int start_timer(unsigned long int start);
|
|||||||
|
|
||||||
unsigned long int stop_timer(unsigned long int start);
|
unsigned long int stop_timer(unsigned long int start);
|
||||||
|
|
||||||
|
void wait(int sec);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -30,4 +30,9 @@ unsigned long int start_timer(unsigned long int start) {
|
|||||||
|
|
||||||
unsigned long int stop_timer(unsigned long int start) {
|
unsigned long int stop_timer(unsigned long int start) {
|
||||||
return Microsecondes() - start;
|
return Microsecondes() - start;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wait(int sec) {
|
||||||
|
unsigned long int end = Microsecondes() + (sec * DELTA);
|
||||||
|
while (Microsecondes() <= end);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user