Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially used usleep() #35

Open
RootUp opened this issue Jul 10, 2018 · 1 comment
Open

Potentially used usleep() #35

RootUp opened this issue Jul 10, 2018 · 1 comment

Comments

@RootUp
Copy link

RootUp commented Jul 10, 2018

File: catimg/blob/master/src/catimg.c#L138

i.e
usleep(img.delays[frame - 1] * 10000);

The usleep() function suspends execution of the calling thread for (at least) usec microseconds.
The parameter you pass is a minimum time for sleeping. There's no guarantee that the thread will wake up after exactly the time specified. Given the specific dynamics of the scheduler, it may result in longer than expected delays.

Use nanosleep() instead.

Cheers!

@posva
Copy link
Owner

posva commented Jul 10, 2018

A pr and making sure it works with gifs would be nice 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants