Added CThread::Sleep && CThread::GetTicks methods

This commit is contained in:
Nik Henson 2012-01-16 22:07:17 +00:00
parent 67036014f8
commit b7242d27e8
2 changed files with 24 additions and 0 deletions

View file

@ -35,6 +35,16 @@
#include <SDL_thread.h>
#endif
void CThread::Sleep(UINT32 ms)
{
SDL_Delay(ms);
}
UINT32 CThread::GetTicks()
{
return SDL_GetTicks();
}
CThread *CThread::CreateThread(ThreadStart start, void *startParam)
{
SDL_Thread *impl = SDL_CreateThread(start, startParam);

View file

@ -48,6 +48,20 @@ private:
public:
/*
* Sleep
*
* Sleeps for specified number of milliseconds.
*/
static void Sleep(UINT32 ms);
/*
* GetTicks
*
* Gets number of millseconds since beginning of program.
*/
static UINT32 GetTicks();
/*
* CreateThread
*
* Creates a new thread with the given ThreadStart callback and start parameter. The thread starts running immediately.