Cocos2dx:获取系统毫秒时间

Cocos2dx:获取系统毫秒时间,第1张

概述   在CCTime中,存在接口gettimeofdayCocos2d: class CC_DLL CCTime{public: static int gettimeofdayCocos2d(struct cc_timeval *tp, void *tzp); static double timersubCocos2d(struct cc_timeval *start, str

在CCTime中,存在接口gettimeofdayCocos2d:

class CC_DLL CCTime{public:    static int gettimeofdayCocos2d(struct cc_timeval *tp,voID *tzp);    static double timersubCocos2d(struct cc_timeval *start,struct cc_timeval *end);};

我们调用接口获取时间,但是这个时间只有秒和微妙,就需要我们自己进行装换了:
int getCurrentTime(){    struct cc_timeval Now;    CCTime::gettimeofdayCocos2d(&Now,NulL);    return Now.tv_sec * 1000 + Now.tv_usec / 1000;}
总结

以上是内存溢出为你收集整理的Cocos2dx:获取系统毫秒时间全部内容,希望文章能够帮你解决Cocos2dx:获取系统毫秒时间所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1067346.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存