Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
alx-sch committed Oct 13, 2024
2 parents 595a08f + b64d46b commit d7f91a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Compile with `make FANCY=1` to activate this feature.
## Comparing `usleep` with a Custom Wait Function
I have implemented a custom wait function to address common issues with `usleep`, such as inconsistent delays. To illustrate the performance differences, I have included a test script: [`test_usleep.c`](https://github.com/alx-sch/42_philosophers/blob/main/test_usleep.c).

You can use this script to compare the performance of `usleep()` and the custom wait function. The script measures the accuracy and consistency of both functions over multiple runs.
You can use this script to compare the performance of `usleep()` and the custom wait function on your system. The script measures the accuracy and consistency of both functions over multiple runs.

To compile and run the test, use the following command:
```bash
cc test_usleep.c -lm -o test_usleep
./test_usleep <sleep_duration_us> <sleep_intervals> <iterations>
./test_usleep 300000 10000 100
./test_usleep 300000 100000 100
```

<img src="https://github.com/alx-sch/42_philosophers/blob/main/.assets/usleep_test_run.png" alt="usleep_test_run.png" width="400" />
Expand Down

0 comments on commit d7f91a4

Please sign in to comment.