我使用以下代码
unsigned long long appUtils::GetCurrentTime() {
struct timeval tv;
gettimeofday(&tv, NULL);
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
此代码在 OSX 平台上运行。clang编译后输出为1618460301601,这个结果是正确的我在NDK下,r17c r21d
unsigned long long xx = appUtils::GetCurrentTime();
LOGD("app current time: %u %llu %lld", xx, xx, xx);
// OUTPUT app current time: 3553827972 15263574918903831684 6951239348438933920
但是我用NDK在模拟器或者手机上编译运行,会得到这个值 3553827972 如何获取当前时间