You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
487 B
18 lines
487 B
namespace CMSGame
|
|
{
|
|
static class TimeHelper
|
|
{
|
|
/// <summary>获取自引擎启动后经过的时间。</summary>
|
|
public static double GetTicks()
|
|
{
|
|
return Time.GetTicksMsec() / 1000.0;
|
|
}
|
|
|
|
/// <summary>将时间(单位为秒)格式化为字符串“时:分:秒.毫秒”。</summary>
|
|
public static string FormatTime(double time)
|
|
{
|
|
return TimeSpan.FromSeconds(time).ToString("c");
|
|
}
|
|
}
|
|
}
|