SAE11_2022/timer.c

13 lines
313 B
C
Raw Permalink Normal View History

2022-12-02 22:14:06 +01:00
#include <stdlib.h>
#include <graph.h>
2022-12-08 11:53:33 +01:00
#include <stdio.h>
2022-12-02 22:14:06 +01:00
2022-12-08 21:56:21 +01:00
unsigned long timer(unsigned long temps_ecoule, unsigned long temps_microsec){
2022-12-08 11:53:33 +01:00
unsigned long temps_actuel = Microsecondes();
if (temps_actuel > temps_microsec + 1000000){
temps_microsec = temps_actuel;
2022-12-08 21:56:21 +01:00
temps_ecoule += 1;
2022-12-02 22:14:06 +01:00
}
2022-12-08 21:56:21 +01:00
return temps_ecoule;
2022-12-02 22:14:06 +01:00
}