Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-sch authored Dec 12, 2024
1 parent 0bf62a9 commit 1d27b6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ int precise_wait(int duration_to_wait)
unsigned long long current_time;

time_stop_waiting = get_time();

if (time_stop_waiting == 0)
return (1);

time_stop_waiting += duration_to_wait;

while (1)
{
current_time = get_time();
Expand All @@ -83,6 +86,7 @@ int precise_wait(int duration_to_wait)
break ;
(void)usleep((duration_to_wait * 1000) / SLEEP_INTERVALS);
}

return (0);
}
```
Expand Down

0 comments on commit 1d27b6a

Please sign in to comment.