mirror of
https://github.com/thug1src/thug.git
synced 2024-11-30 12:06:44 +00:00
121 lines
4.3 KiB
C++
121 lines
4.3 KiB
C++
/*****************************************************************************
|
|
** **
|
|
** Neversoft Entertainment **
|
|
** **
|
|
** Copyright (C) 1999 - All Rights Reserved **
|
|
** **
|
|
******************************************************************************
|
|
** **
|
|
** Project: SYS Library **
|
|
** **
|
|
** Module: Timer (TMR) **
|
|
** **
|
|
** File name: ngps/p_timer.cpp **
|
|
** **
|
|
** Created by: 09/25/00 - dc **
|
|
** **
|
|
** Description: XBox System Timer **
|
|
** **
|
|
*****************************************************************************/
|
|
|
|
|
|
/*****************************************************************************
|
|
** Includes **
|
|
*****************************************************************************/
|
|
|
|
#include <windows.h>
|
|
#include <mmsystem.h>
|
|
#include <time.h>
|
|
#include <sys/timer.h>
|
|
|
|
/*****************************************************************************
|
|
** DBG Information **
|
|
*****************************************************************************/
|
|
|
|
namespace Tmr
|
|
{
|
|
|
|
/*****************************************************************************
|
|
** Externals **
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
** Defines **
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
** Private Types **
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
** Private Data **
|
|
*****************************************************************************/
|
|
|
|
//static clock_t start_count;
|
|
|
|
/*****************************************************************************
|
|
** Public Data **
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
** Private Prototypes **
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
** Private Functions **
|
|
*****************************************************************************/
|
|
|
|
/******************************************************************/
|
|
/* */
|
|
/* */
|
|
/******************************************************************
|
|
|
|
Manager::Manager ( void )
|
|
{
|
|
Dbg_MemberFunction;
|
|
|
|
// Set the start count.
|
|
start_count = timeGetTime();
|
|
}
|
|
|
|
/******************************************************************/
|
|
/* */
|
|
/* */
|
|
/******************************************************************
|
|
|
|
Manager::~Manager ( void )
|
|
{
|
|
Dbg_MemberFunction;
|
|
}
|
|
|
|
/*****************************************************************************
|
|
** Public Functions **
|
|
*****************************************************************************/
|
|
|
|
Time GetTime ( void )
|
|
{
|
|
return timeGetTime();
|
|
}
|
|
|
|
/******************************************************************/
|
|
/* */
|
|
/* */
|
|
/******************************************************************/
|
|
|
|
MicroSeconds GetTimeInUSeconds( void )
|
|
{
|
|
return timeGetTime() * 1000;
|
|
}
|
|
|
|
float FrameLength()
|
|
{
|
|
return 16;
|
|
}
|
|
|
|
/******************************************************************/
|
|
/* */
|
|
/* */
|
|
/******************************************************************/
|
|
|
|
} // namespace Tmr
|