2023-07-22 10:34:16 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <time.h>
|
2023-07-22 15:15:41 +08:00
|
|
|
#include "includes/time_delay.h"
|
2023-07-22 10:34:16 +08:00
|
|
|
void time_delay(int sec)
|
|
|
|
{
|
2023-07-22 15:15:41 +08:00
|
|
|
int s_time, e_time;
|
|
|
|
s_time = time(NULL);
|
|
|
|
while (1)
|
2023-07-22 10:34:16 +08:00
|
|
|
{
|
2023-07-22 15:15:41 +08:00
|
|
|
e_time = time(NULL);
|
|
|
|
if (e_time == s_time + sec)
|
2023-07-22 10:34:16 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-07-22 15:15:41 +08:00
|
|
|
// int main(int argc, char *argv[])
|
|
|
|
// {
|
|
|
|
// while(1)
|
|
|
|
// {
|
|
|
|
// printf("hello world\n");
|
|
|
|
// time_delay(3);
|
|
|
|
// }
|
|
|
|
// return 0;
|
|
|
|
// }
|