当前位置:网站首页>PHP获取当前时间戳三位毫秒 - 毫秒时间戳
PHP获取当前时间戳三位毫秒 - 毫秒时间戳
2022-07-23 06:35:00 【Rudon滨海渔村】
<?php
/**
* 获取当前三位数的毫秒数 - 字符串 或 整数
*
* @param boolean $return_number 是否要求返回正整数类型的毫秒数,默认false
*
* @return string|int 毫秒数
*/
function get_current_3_digit_millisecond ( $return_number = false ) {
// 获取毫秒字符串 + 整数时间戳
// "0.04009600 1658461202"
list($ms, $timestamp) = explode(' ', microtime());
// 判断是否返回字符串格式
if ($return_number) {
// 整数
$res = intval(substr($ms, 2, 3));
} else {
// 字符串
$res = substr($ms, 2, 3);
}
return $res;
}
// 例子
$nums = get_current_3_digit_millisecond();
var_dump($nums); // "040"边栏推荐
- Day 11 notes
- 【MUDUO】EPOLLPOLLER事件分发器
- Wu Enda machine learning series p31~p42
- Charles抓包工具测试实战
- MySQL index transaction & JDBC programming
- Beifu PLC and C transmit structure type variables through ads communication
- 分类模型的评估
- Point target simulation of SAR imaging (II) -- matlab simulation
- php连接sql server
- Beifu PLC and C transmit int array type variables through ads communication
猜你喜欢

UI automation

Opencv image processing (medium) image smoothing + histogram

倍福PLC和C#通过ADS通信传输int类型变量

Course design - push box C (win form)

射击游戏 第 1-2 课:使用精灵

Wu Enda machine learning series p31~p42

Beifu PLC and C transmit bool array variables through ads communication

Evaluation of classification model

ROS2自学笔记:URDF机器人建模

Beifu PLC and C transmit string type through ads communication
随机推荐
Smart city infrastructure management based on bim+3dgis
Point target simulation of SAR imaging (I) -- mathematical model
“算力猛兽”浪潮NF5468A5 GPU服务器开放试用免费申请
Space shooting part 2-2: enemy spirit
第十一天笔记
Beifu PLC and C transmit bool array variables through ads communication
Jenkins continuous integration error stderr: fatal: unsafe repository ('/home/water/water' is owned by someone else)
知识图谱:基本概念
Wu Enda machine learning series p31~p42
Debug No5基础光照
QNX修改系统时间
射击 第 1-3 课:图像精灵
我为大厂怒刷的《100道Android面试题》
【PART 2】OAK-D+TurtleBot3机器人项目全解析
Shooting games lesson 1-2: using sprites
Opencv image processing (medium) image smoothing + histogram
Talk about study and work -- Qian Xuesen
DeFi 永不消亡?
Summary of time complexity( Ο Is the asymptotic upper bound, Ω is the asymptotic lower bound, P, NP, NP hard, NPC problem)
Metaapp development interview questions