move point to raise exception
[sunny256-utils.git] / Div / HiRes-test
blobd8d3383853db5f6e5f12cef587fc27739738d781
1 #!/usr/bin/env perl
3 #=======================================================================
4 # $Id$
5 #=======================================================================
7 use strict;
8 use warnings;
9 use POSIX qw{ strftime };
10 use Time::HiRes qw{ gettimeofday };
11 use Getopt::Long;
13 my $Debug = 0;
15 while (1) {
16 my $curr_time = sprintf("%.6f", 1.0 * Time::HiRes::time());
17 my ($Sec, $Min, $Hour, $Day, $Mon, $Year, $Wday, $Yday) = gmtime(1.0 * $curr_time - 0.0);
18 $Sec = sprintf("%02u", $Sec);
19 $Min = sprintf("%02u", $Min);
20 $Hour = sprintf("%02u", $Hour);
21 $Day = sprintf("%02u", $Day);
22 $Mon = sprintf("%02u", $Mon + 1);
23 $Year = sprintf("%04u", $Year + 1900);
24 # D("curr_time = '$curr_time'");
25 my $Date = "$Year-$Mon-${Day}T$Hour:$Min:$Sec" .
26 ($curr_time =~ /^(\d+)(\.\d+)/ ? $2 : "") .
27 "Z";
28 print("$Date\n");
31 sub D {
32 # Print a debugging message {{{
33 $Debug || return;
34 my @call_info = caller;
35 chomp(my $Txt = shift);
36 my $File = $call_info[1];
37 $File =~ s#\\#/#g;
38 $File =~ s#^.*/(.*?)$#$1#;
39 print(STDERR "$File:$call_info[2] $$ $Txt\n");
40 return("");
41 # }}}
42 } # D()