当前位置:网站首页>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 .
边栏推荐
- GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021
- redis探索之缓存击穿、缓存雪崩、缓存穿透
- Switch basic experiment
- 晓看天色暮看云,美图欣赏
- 腾讯黎巍:深耕“监管科技”,护航数字经济行稳致远
- 阿霍的三个阶段
- 华为面试题: 招聘
- (mixed version 1) multiple TXT text to one table
- 单点登录SSO与JWT好文整理
- 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
猜你喜欢

leetcode:226. 翻转二叉树【dfs翻转】

2022-06-28-06-29
![[20220605] Literature Translation -- visualization in virtual reality: a systematic review](/img/11/6c42957186bf530e8f9d4025a40197.png)
[20220605] Literature Translation -- visualization in virtual reality: a systematic review
![[datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn](/img/f2/7931952b832e84d7b8f2615906f33f.png)
[datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn
![leetcode:241. Design priority for operation expression [DFS + Eval]](/img/d0/8dedeba7ecedccd25e0e3e96ff3362.png)
leetcode:241. Design priority for operation expression [DFS + Eval]

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

redis探索之缓存一致性

Common chart usage of Bi tools
随机推荐
基于.NetCore开发博客项目 StarBlog - (13) 加入友情链接功能
Friends day 2022
下半年还有很多事要做
I wish you all a happy reunion
华为面试题: 招聘
MHA high availability cluster deployment and failover of database
"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
【MAUI】为 Label、Image 等控件添加点击事件
快速整明白Redis中的压缩列表到底是个啥
Interpretation of hard threshold function [easy to understand]
Need your own cognition
logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
数论基础及其代码实现
微信小程序 – 80个实用的微信小程序项目实例
Wechat simulated geographical location_ Camouflage wechat location
Using burpsuite to capture app packages
腾讯总考epoll, 很烦
ASP.NET Core 6 从入门到企业级实战开发应用技术汇总
Ansible的playbook
[Maui] add click events for label, image and other controls