java - 将 python time.time() 转换为 java.nanoTime()

标签 java python nanotime

java 的 System.nanoTime() 似乎给出了一个 long: 1337203874231141000L 而 python time.time() 会给出类似 1337203880.462787

如何将 time.time() 的值转换为与 System.nanoTime() 匹配的值?

最佳答案

你不能。

来自documentation :

This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time. The value returned represents nanoseconds since some fixed but arbitrary time (perhaps in the future, so values may be negative).

关于java - 将 python time.time() 转换为 java.nanoTime(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10627055/

相关文章:

java - Android Activity 转换动画仅适用于被调用的 Activity

java - 为什么搜索次数越多,搜索时间就越短?

android - SensorEvent.timestamp 不一致

java - Java 的免费时间线可视化 API?

java - 在 Spring boot 应用程序项目中使用 Wildfly

java - 将架构名称添加到 Spring 数据中的实体?

python - 使用lxml获取div HTML内容

python - OpenCV 中的自适应阈值(版本 1 - swig 版本)

python - PyQt QWidget 窗口在显示后立即关闭?

perl - 如何在 Perl 中以纳秒为单位获取系统时间?