dl
dl::Time类 参考

时间 更多...

#include <dl_time.h>

Public 类型

enum  Type {
  ET_YEAR = 1 << 1 , ET_MONTH = 1 << 2 , ET_DAY = 1 << 3 , ET_HOUR = 1 << 4 ,
  ET_MINUTE = 1 << 5 , ET_SECOND = 1 << 6 , ET_YMD = ET_YEAR | ET_MONTH | ET_DAY , ET_HMS = ET_HOUR | ET_MINUTE | ET_SECOND ,
  ET_YMD_HMS = ET_YMD | ET_HMS
}
 

Public 成员函数

 Time ()
 
FloatTime GetDelta ()
 返回帧间隔
 
unsigned GetFPS ()
 返回fps
 
void SetFPS (unsigned fps)
 设置fps
 
FloatTime GetCurrent ()
 返回游戏运行累计时间
 
double GetCurrent64 ()
 返回游戏运行累计时间
 
time_t GetFrameTimeStamp ()
 返回当前帧时间戳
 
time_t GetFrameTimeStampMs ()
 返回当前帧时间戳(毫秒)
 
unsigned GetFrameTkc ()
 返回当前帧tick(毫秒)
 

静态 Public 成员函数

static time_t GetTimeStamp ()
 返回时间戳
 
static time_t GetTimeStampMs ()
 返回时间戳(毫秒)
 
static std::string TimeStampDelta2String (time_t t)
 时间戳间隔 -> xx:xx:xx
 
static std::string TimeStamp2String (time_t t, Type type=ET_HMS, std::string_view year="-", std::string_view month="-", std::string_view day=" ", std::string_view hour=":", std::string_view minute=":", std::string_view second="")
 时间戳 -> 字符串
 
static std::string ExTimeStamp2StringLog ()
 
static void Sleep (unsigned t=0)
 阻塞线程毫秒数(不精确)
 

友元

class System
 

详细描述

时间

在文件 dl_time.h22 行定义.

成员枚举类型说明

◆ Type

枚举值
ET_YEAR 
ET_MONTH 
ET_DAY 
ET_HOUR 
ET_MINUTE 
ET_SECOND 
ET_YMD 
ET_HMS 
ET_YMD_HMS 

在文件 dl_time.h117 行定义.

构造及析构函数说明

◆ Time()

dl::Time::Time ( )
inline

在文件 dl_time.h26 行定义.

成员函数说明

◆ ExTimeStamp2StringLog()

static std::string dl::Time::ExTimeStamp2StringLog ( )
inlinestatic

在文件 dl_time.h137 行定义.

◆ GetCurrent()

FloatTime dl::Time::GetCurrent ( )
inline

返回游戏运行累计时间

在文件 dl_time.h63 行定义.

◆ GetCurrent64()

double dl::Time::GetCurrent64 ( )
inline

返回游戏运行累计时间

在文件 dl_time.h72 行定义.

◆ GetDelta()

FloatTime dl::Time::GetDelta ( )
inline

返回帧间隔

在文件 dl_time.h41 行定义.

◆ GetFPS()

unsigned dl::Time::GetFPS ( )
inline

返回fps

在文件 dl_time.h48 行定义.

◆ GetFrameTimeStamp()

time_t dl::Time::GetFrameTimeStamp ( )
inline

返回当前帧时间戳

在文件 dl_time.h82 行定义.

◆ GetFrameTimeStampMs()

time_t dl::Time::GetFrameTimeStampMs ( )
inline

返回当前帧时间戳(毫秒)

在文件 dl_time.h89 行定义.

◆ GetFrameTkc()

unsigned dl::Time::GetFrameTkc ( )
inline

返回当前帧tick(毫秒)

注解
自启动程序时间

在文件 dl_time.h97 行定义.

◆ GetTimeStamp()

static time_t dl::Time::GetTimeStamp ( )
static

返回时间戳

◆ GetTimeStampMs()

static time_t dl::Time::GetTimeStampMs ( )
static

返回时间戳(毫秒)

◆ SetFPS()

void dl::Time::SetFPS ( unsigned fps)
inline

设置fps

在文件 dl_time.h55 行定义.

◆ Sleep()

static void dl::Time::Sleep ( unsigned t = 0)
static

阻塞线程毫秒数(不精确)

◆ TimeStamp2String()

static std::string dl::Time::TimeStamp2String ( time_t t,
Type type = ET_HMS,
std::string_view year = "-",
std::string_view month = "-",
std::string_view day = " ",
std::string_view hour = ":",
std::string_view minute = ":",
std::string_view second = "" )
static

时间戳 -> 字符串

注解
非线程安全

◆ TimeStampDelta2String()

static std::string dl::Time::TimeStampDelta2String ( time_t t)
static

时间戳间隔 -> xx:xx:xx

注解
最多计算到小时

友元及相关符号说明

◆ System

friend class System
friend

在文件 dl_time.h24 行定义.


该类的文档由以下文件生成: