mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[common] timer: fix timespec parameters when interval >= 1000
This commit is contained in:
parent
e4e1451eaa
commit
2736e37e4a
@ -77,8 +77,8 @@ bool lgCreateTimer(const unsigned int intervalMS, LGTimerFn fn,
|
||||
|
||||
struct timespec interval =
|
||||
{
|
||||
.tv_sec = 0,
|
||||
.tv_nsec = intervalMS * 1000 * 1000,
|
||||
.tv_sec = intervalMS / 1000,
|
||||
.tv_nsec = (intervalMS % 1000) * 1000000,
|
||||
};
|
||||
struct itimerspec spec =
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user