12345678910111213141516171819202122232425262728293031323334353637383940 |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- use warnings;
-
- use Time::HiRes qw|time|;
- use POSIX qw|modf|;
-
- sub stamp {
- my $time = shift;
- my ($sec, $min, $hour,
- $mday, $mon, $year,
- $wday, $yday, $isdst) = (localtime($time));
- return sprintf
- "%04i-%02i-%02i %02i:%02i:%02i.%05i",
- $year + 1900, $mon + 1, $mday,
- $hour, $min, $sec,
- ( modf $time)[0] * 100000;
- }
-
- while (1) {
- print stamp Time::HiRes::time();
- print "\n";
- sleep 1;
- }
|