[[NSProcessInfo processInfo] systemUptime];
或者
#include <mach/mach.h>
#include <mach/mach_time.h>
long long tm = mach_absolute_time();
static mach_timebase_info_data_t sTimebaseInfo;
if ( sTimebaseInfo.denom == 0 ) //静态整型变量初始化时默认为0
{
mach_timebase_info(&sTimebaseInfo);
}
return tm * sTimebaseInfo.numer / sTimebaseInfo.denom / (1000*1000);
发表回复
要发表评论,您必须先登录。