BlinkenArea - GitList
Repositories
Blog
Wiki
BlinkenLib
Code
Commits
Branches
Tags
Search
Tree:
0136d7b
Branches
Tags
master
v0.1
v0.2
v0.3
v0.3.1
v0.4
v0.4.1
v0.5
v0.5.1
v0.5.2
v0.5.3
v0.5.4
v0.5.5
v0.6.0
v0.6.1
v0.6.2
v0.6.3
v0.6.4
v0.6.5
v0.6.6
v0.6.7
v0.6.8
v0.6.9
v0.7.0
v0.7.1
v0.7.10
v0.7.2
v0.7.3
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.7.9
v0.8.0
v0.8.1
BlinkenLib
src
BlinkenTools.c
make MSleep and GetMS public in headers
Stefan Schuermans
commited
0136d7b
at 2023-08-18 10:24:40
BlinkenTools.c
Blame
History
Raw
/* BlinkenLib Copyright 2004-2023 Stefan Schuermans <stefan@schuermans.info> Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html a blinkenarea.org project */ #include "Tools.h" #ifdef WIN32 #include <windows.h> #include <winsock2.h> #else #include <sys/time.h> #include <unistd.h> #endif #ifdef WIN32 void BlinkenMSleep(unsigned int ms) { Sleep(ms); } unsigned int BlinkenGetMs(void) { return GetTickCount(); } #else void BlinkenMSleep(unsigned int ms) { usleep(ms * 1000); } unsigned int BlinkenGetMs(void) { struct timeval tv; gettimeofday(&tv, NULL); return (unsigned int)(tv.tv_usec / 1000 + tv.tv_sec * 1000); } #endif