Sunday, May 31, 2009

High precision timestamps in Perl5/Perl6?

Why does Perl5 and Perl6 chop off a digit of precision on a high precision time call?

use strict;
use Data::Dumper;
use Time::HiRes qw( gettimeofday );

print gettimeofday() . "\n";
printf("%f\n", scalar(gettimeofday()));

Produces:

1243793974.02361
1243793974.023704


And, in Perl 6...

say time();
printf("%f\n", time());

Produces:

1243794052.38889
1243794052.391031

2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Perl6 is a very successful project it reminds me the knee anatomy facts a few years ago.

    ReplyDelete