+ (NSTimeInterval)processCreateTime {
pid_t pid = [[NSProcessInfo processInfo] processIdentifier];
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };
struct kinfo_proc proc;
size_t size = sizeof(proc);
sysctl(mib, 4, &proc, &size, NULL, 0);
return proc.kp_proc.p_starttime.tv_sec;
}
iOS获取进程创建的时间
![](https://img-home.csdnimg.cn/images/20240711042549.png)