1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

chore: replaced msleep by std::this_thread::sleep_for

This commit is contained in:
Falk Werner
2020-03-01 17:23:59 +01:00
parent 1a29b44ad6
commit 107e66b65a
8 changed files with 22 additions and 47 deletions

View File

@@ -1,19 +0,0 @@
#include "webfuse/utils/msleep.hpp"
#include <ctime>
namespace webfuse_test
{
void msleep(long millis)
{
long const secs_per_msec = 1000;
long const msecs_per_nsec = (1000 * 1000);
long const seconds = millis / secs_per_msec;
long const nanos = (millis % secs_per_msec) * msecs_per_nsec;
struct timespec timeout = { seconds, nanos };
while (0 != nanosleep(&timeout, &timeout));
}
}

View File

@@ -1,12 +0,0 @@
#ifndef WF_TEST_MSLEEP_HPP
#define WF_TEST_MSLEEP_HPP
namespace webfuse_test
{
extern void msleep(long millis);
}
#endif