当前位置:网站首页>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 .
边栏推荐
- Friends day 2022
- Ansi/ul 94 VTM vertical burning test for thin materials
- Ansible的playbook
- 晓看天色暮看云,美图欣赏
- 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
- Question d'entrevue de Huawei: recrutement
- [Suanli network] technological innovation of Suanli Network -- key technology of operation service
- redis探索之缓存击穿、缓存雪崩、缓存穿透
- 基因检测,如何帮助患者对抗疾病?
- MySQL的零拷贝技术
猜你喜欢

Ikvm of toolbox Net project new progress

Manage nodejs with NVM (downgrade the high version to the low version)

【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告

队列的链式存储
![leetcode:226. Flip binary tree [DFS flip]](/img/b8/6c5596ac30de59f0f347bb0bddf574.png)
leetcode:226. Flip binary tree [DFS flip]
![[some notes]](/img/91/7657f90b50f012736579b1585b4ade.jpg)
[some notes]

2022-06-28-06-29

数据库之MHA高可用集群部署及故障切换

What are the PHP FPM configuration parameters

How to use opcache, an optimization acceleration component of PHP
随机推荐
《MATLAB 神经网络43个案例分析》:第40章 动态神经网络时间序列预测研究——基于MATLAB的NARX实现
快速整明白Redis中的压缩列表到底是个啥
有人碰到过这种情况吗,oracle logminer 同步的时候,clob字段的值丢失
数论基础及其代码实现
redis探索之缓存击穿、缓存雪崩、缓存穿透
Accept different views with an open mind
2022-06-28-06-29
高薪程序员&面试题精讲系列118之Session共享有哪些方案?
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
79. 单词搜索【dfs + 回溯visit + 遍历起点】
[Suanli network] technological innovation of Suanli Network -- key technology of operation service
单点登录SSO与JWT好文整理
使用BurpSuite对app抓包教程
MySQL common functions
Simple Fibonacci (recursive)
哪个券商公司开户佣金低又安全又可靠
SQLAlchemy在删除有外键约束的记录时,外键约束未起作用,何解?
There are risks in trading
Sleep quality today 79 points
【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告