当前位置:网站首页>Ustime wrote a bug
Ustime wrote a bug
2022-07-01 12:41:00 【Tao song remains the same】
lately , Wrote a ustime function , Accidentally made a bug, Checked the , Repair the .
then , I think , This function should be very common , So I searched the open source code , Sure enough , Come and see what others write :
/* Return the UNIX time in microseconds */
long long ustime(void) {
struct timeval tv;
long long ust;
gettimeofday(&tv, NULL);
ust = ((long long)tv.tv_sec)*1000000;
ust += tv.tv_usec;
return ust;
}
/* Return the UNIX time in milliseconds */
mstime_t mstime(void) {
return ustime()/1000;
}
After testing , OK, It's much clearer .
边栏推荐
- 華為面試題: 招聘
- Chained storage of queues
- ASP.NET Core 6 从入门到企业级实战开发应用技术汇总
- Simple Fibonacci (recursive)
- 手把手教你完成图像分类实战——基于卷积神经网络的图像识别
- R language builds a binary classification model based on H2O package: using H2O GBM build gradient hoist model GBM, use H2O AUC value of AUC calculation model
- [datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn
- Switch basic experiment
- Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
- ustime写出了bug
猜你喜欢

《MATLAB 神经网络43个案例分析》:第40章 动态神经网络时间序列预测研究——基于MATLAB的NARX实现

BIM and safety in road maintenance-buildSmart Spain
![leetcode:241. Design priority for operation expression [DFS + Eval]](/img/d0/8dedeba7ecedccd25e0e3e96ff3362.png)
leetcode:241. Design priority for operation expression [DFS + Eval]

【脑洞大开】《西潮》及《走向世界丛书》
![leetcode:226. Flip binary tree [DFS flip]](/img/b8/6c5596ac30de59f0f347bb0bddf574.png)
leetcode:226. Flip binary tree [DFS flip]

Ikvm of toolbox Net project new progress

Queue operation---

79. 单词搜索【dfs + 回溯visit + 遍历起点】

codeforces -- 4B. Before an Exam
![[today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world](/img/41/76687ea13e1722654b235f2cfa66ce.png)
[today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
随机推荐
Blocking sockets的读写操作该怎么玩?
晓看天色暮看云,美图欣赏
腾讯总考epoll, 很烦
手机便签应用
Queue operation---
6.30模拟赛总结
79. Word search [DFS + backtracking visit + traversal starting point]
VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
【MAUI】为 Label、Image 等控件添加点击事件
2022-06-28-06-29
Need your own cognition
ustime写出了bug
Chapter 14 signals (IV) - examples of multi process tasks
List of QT players [easy to understand]
Four years after graduation: work, resign, get married, buy a house
有人碰到过这种情况吗,oracle logminer 同步的时候,clob字段的值丢失
Like the three foot platform
Switch basic experiment
华为面试题: 招聘
System test UI test summary and questions (interview)