mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-01 01:25:33 +03:00
67 lines
1.3 KiB
C++
67 lines
1.3 KiB
C++
//========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================
|
|
|
|
#include "precompiled.h"
|
|
#include "tier0/platform.h"
|
|
#include "tier0/memalloc.h"
|
|
#include "tier0/dbg.h"
|
|
|
|
#include <sys/time.h>
|
|
#include <unistd.h>
|
|
|
|
|
|
double Plat_FloatTime()
|
|
{
|
|
struct timeval tp;
|
|
static int secbase = 0;
|
|
|
|
gettimeofday(&tp, NULL);
|
|
|
|
if (!secbase)
|
|
{
|
|
secbase = tp.tv_sec;
|
|
return (tp.tv_usec / 1000000.0);
|
|
}
|
|
|
|
return ((tp.tv_sec - secbase) + tp.tv_usec / 1000000.0);
|
|
}
|
|
|
|
unsigned long Plat_MSTime()
|
|
{
|
|
struct timeval tp;
|
|
static int secbase = 0;
|
|
|
|
gettimeofday(&tp, NULL);
|
|
|
|
if (!secbase)
|
|
{
|
|
secbase = tp.tv_sec;
|
|
return (tp.tv_usec / 1000000.0);
|
|
}
|
|
|
|
return (unsigned long)((tp.tv_sec - secbase) + tp.tv_usec / 1000000.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool vtune(bool resume)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------- //
|
|
// Memory stuff.
|
|
// -------------------------------------------------------------------------------------------------- //
|
|
|
|
|
|
void Plat_SetThreadName(unsigned long dwThreadID, const char *pName)
|
|
{
|
|
Assert("Plat_SetThreadName not implemented");
|
|
}
|