mirror of
https://codeberg.org/1414codeforge/ubgpsuite.git
synced 2025-06-05 21:29:11 +02:00
[*] Initial commit
This commit is contained in:
25
lonetix/sys/sys_unix.c
Executable file
25
lonetix/sys/sys_unix.c
Executable file
@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
/**
|
||||
* \file sys/sys_unix.c
|
||||
*
|
||||
* General system specific functionality implementation over Unix.
|
||||
*
|
||||
* \copyright The DoubleFourteen Code Forge (C) All Rights Reserved
|
||||
* \author Lorenzo Cogotti
|
||||
*/
|
||||
|
||||
#include "sys/sys_local.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
void Sys_SleepMillis(Uint32 millis)
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
ts.tv_sec = millis / 1000;
|
||||
ts.tv_nsec = (millis % 1000) * 1000000uLL;
|
||||
|
||||
int res;
|
||||
do res = nanosleep(&ts, &ts); while (res != 0); // res != 0 -> EINTR
|
||||
}
|
Reference in New Issue
Block a user