修复
This commit is contained in:
@ -1,9 +1,13 @@
|
||||
#include "IS3Comon.h"
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
void delay(int ms){
|
||||
Sleep(ms);
|
||||
}
|
||||
#else
|
||||
|
||||
void delay(int ms){
|
||||
usleep(ms * 1000); // Convert milliseconds to microseconds
|
||||
}
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#ifndef _POSIX_C_SOURCE
|
||||
@ -16,13 +20,12 @@
|
||||
unsigned long long get_system_uptime_ms() {
|
||||
#ifdef _WIN32
|
||||
return GetTickCount64();
|
||||
|
||||
#else
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return (unsigned long long)(ts.tv_sec) * 1000 + ts.tv_nsec / 1000000;
|
||||
void Sleep(long ms) {
|
||||
usleep(ms*1000); // Sleep for 1 millisecond
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
@ -30,9 +33,7 @@ unsigned long long get_system_uptime_ms() {
|
||||
|
||||
|
||||
|
||||
void delay(int ms){
|
||||
Sleep(ms);
|
||||
}
|
||||
|
||||
|
||||
|
||||
u_char BufferForRead[10000];
|
||||
|
Reference in New Issue
Block a user