Perl DateTime 纳秒始终为 0

Perl DateTime nanoseconds always 0

如何从 Perl 中的 DateTime 获取纳秒?

我试试

say DateTime->from_epoch(epoch => time)->nanosecond; # 0
say DateTime->from_epoch(epoch => time)->strftime('%9N'); # 0

time returns the number of (whole) seconds since the start of the unix epoch. Time::HiRes 提供了分辨率更高的 time 版本。