mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Initial checkin of unified hierarchy of WPILib 2015
This commit is contained in:
33
networktables/cpp/Win32/src/main/native/OSAL/System.cpp
Normal file
33
networktables/cpp/Win32/src/main/native/OSAL/System.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
/*
|
||||
* System.cpp
|
||||
*
|
||||
* Created on: Sep 26, 2012
|
||||
* Author: Mitchell Wills
|
||||
*/
|
||||
|
||||
#include "windows.h"
|
||||
#include "networktables2/util/System.h"
|
||||
//#include "semLib.h"
|
||||
#include <stdio.h>
|
||||
//#include <sysLib.h> // for sysClkRateGet
|
||||
//#include <usrLib.h> // for taskDelay
|
||||
//timeGetTime() uses Winmm.lib
|
||||
#pragma comment (lib,"Winmm.lib")
|
||||
#pragma comment( lib, "Ws2_32" )
|
||||
void sleep_ms(unsigned long ms){
|
||||
//taskDelay((INT32)((double)sysClkRateGet() * ms / 1000));
|
||||
Sleep(ms);
|
||||
}
|
||||
unsigned long currentTimeMillis(){
|
||||
//struct timespec tp;
|
||||
//clock_gettime(CLOCK_REALTIME,&tp);
|
||||
DWORD dwTick_ = timeGetTime();
|
||||
//return tp.tv_sec*1000 + tp.tv_nsec/1000;
|
||||
return (long)dwTick_;
|
||||
}
|
||||
void writeWarning(const char* message){
|
||||
fprintf(stderr, "%s\n", message);
|
||||
fflush(stderr);
|
||||
//TODO implement write warning with wpilib error stuff
|
||||
}
|
||||
Reference in New Issue
Block a user