本文整理汇总了C++中CSysInfo::GetTotalUptime方法的典型用法代码示例。如果您正苦于以下问题:C++ CSysInfo::GetTotalUptime方法的具体用法?C++ CSysInfo::GetTotalUptime怎么用?C++ CSysInfo::GetTotalUptime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSysInfo
的用法示例。
在下文中一共展示了CSysInfo::GetTotalUptime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSystemUpTime
std::string CSysInfoJob::GetSystemUpTime(bool bTotalUptime)
{
std::string strSystemUptime;
int iInputMinutes, iMinutes,iHours,iDays;
if(bTotalUptime)
{
//Total Uptime
iInputMinutes = g_sysinfo.GetTotalUptime() + ((int)(XbmcThreads::SystemClockMillis() / 60000));
}
else
{
//Current UpTime
iInputMinutes = (int)(XbmcThreads::SystemClockMillis() / 60000);
}
SystemUpTime(iInputMinutes,iMinutes, iHours, iDays);
if (iDays > 0)
{
strSystemUptime = StringUtils::Format("%i %s, %i %s, %i %s",
iDays, g_localizeStrings.Get(12393).c_str(),
iHours, g_localizeStrings.Get(12392).c_str(),
iMinutes, g_localizeStrings.Get(12391).c_str());
}
else if (iDays == 0 && iHours >= 1 )
{
strSystemUptime = StringUtils::Format("%i %s, %i %s",
iHours, g_localizeStrings.Get(12392).c_str(),
iMinutes, g_localizeStrings.Get(12391).c_str());
}
else if (iDays == 0 && iHours == 0 && iMinutes >= 0)
{
strSystemUptime = StringUtils::Format("%i %s",
iMinutes, g_localizeStrings.Get(12391).c_str());
}
return strSystemUptime;
}