当前位置:网站首页>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 .
边栏推荐
- Ipv6-6to4 experiment
- Use Net core access wechat official account development
- GID: open vision proposes a comprehensive detection model knowledge distillation | CVPR 2021
- Need your own cognition
- CPI教程-异步接口创建及使用
- Share several tools for designing exquisite circuit diagrams
- Good luck brought by years of persistence
- 使用nvm管理nodejs(把高版本降级为低版本)
- codeforces -- 4B. Before an Exam
- leetcode:226. 翻转二叉树【dfs翻转】
猜你喜欢

I wish you all a happy reunion

How to use opcache, an optimization acceleration component of PHP

BIM and safety in road maintenance-buildSmart Spain

手机便签应用

Stack-------

使用nvm管理nodejs(把高版本降级为低版本)

ROS2 Foxy depthai_ros教程
![[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
![leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]](/img/10/acd162c3adf9d6f14fa5a551dc0d25.png)
leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]

MHA high availability cluster deployment and failover of database
随机推荐
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
Three stages of aho
类的初始化与实例化
Chain storage of binary tree
Interpretation of hard threshold function [easy to understand]
Application of stack -- bracket matching problem
Topic 1004: the story of cows (recursion)
"Analysis of 43 cases of MATLAB neural network": Chapter 40 research on prediction of dynamic neural network time series -- implementation of NARX based on MATLAB
使用BurpSuite对app抓包教程
买卖其实也有风险
Share several tools for designing exquisite circuit diagrams
2022-06-28-06-29
R language uses conf of yardstick package_ The mat function calculates the confusion matrix of the multiclass model on each fold of each cross validation (or resampling), and uses the summary to outpu
Eurake partition understanding
leetcode:241. 为运算表达式设计优先级【dfs + eval】
Circular linked list--
Ipv6-6to4 experiment
Chapter 14 signals (IV) - examples of multi process tasks
Mobile note application
Queue operation---