无需安装额外的软件包即可获得以毫秒为单位的时间?
如何在 Perl 中获取以毫秒为单位的时间而不安装任何额外的软件包?
我正在运行Linux。
How can I get the time in milliseconds in Perl without installing any extra package?
I am running Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Time::HiRes
自 Perl 5.7.3 以来一直是核心的一部分。要检查其可用性,请检查 Perl 版本perl -v
,或尝试将其与perl -e 'use Time::HiRes;'
一起使用,两者均来自命令行。示例用法:
要基于 Konerak 的注释进行构建,如果它不存在或无法使用,请通过反引号使用本机 Linux 命令:
Time::HiRes
has been part of the core since Perl 5.7.3. To check for its availability, check for the Perl version,perl -v
, or try to use it withperl -e 'use Time::HiRes;'
, both from the command line.Sample usage:
To build on Konerak's comment, if it isn't there or it cannot be used, use native Linux commands via backticks: