in reply to missing second of time

Update: After finishing my coffee, I realize that it's normal behavior: it's just an artifact of adding a number slightly larger than an integer (epsilon_1) to another number slightly less than another integer (epsilon_2), where epsilon_1 happens to be greater than epsilon_2. As an example: 5.99 + 1.02 => 7.01

I gave it a few tries and was able to reproduce it:

$ perl -MTime::HiRes=time -le 'while () { $a=time; print $a, " ", $a-$ +b; $b=$a; sleep 1.01 }' Use of uninitialized value $b in subtraction (-) at -e line 1. 1579951233.92519 1579951233.92519 1579951234.92536 1.00017690658569 1579951235.92573 1.00036287307739 1579951236.92672 1.00098919868469 1579951237.93894 1.01222395896912 1579951238.95456 1.01561999320984 1579951239.97017 1.01561403274536 1579951240.98579 1.01561689376831 1579951242.00141 1.01561808586121 !!!! 1579951243.01703 1.01561903953552 $ perl -MTime::HiRes=time -le 'print $Time::HiRes::VERSION' 1.9741 $ perl --version This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-cy +gwin-threads-multi (with 7 registered patches, see perl -V for more detail) Copyright 1987-2018, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at, the Perl Home Pa +ge.

Also including output of perl -V for interested parties:

$ perl -V Summary of my perl5 (revision 5 version 26 subversion 3) configuration +: Platform: osname=cygwin osvers=3.0.7(0.33853) archname=x86_64-cygwin-threads-multi uname='cygwin_nt-10.0 cygwinpro 3.0.7(0.33853) 2019-04-30 18:08 x8 +6_64 cygwin ' config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cyg +win-threads -Dlibperl=cygperl5_26.dll -Dcc=gcc -Dld=g++ -Accflags=-gg +db -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstac +k-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/ +share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.26.3-2 -fd +ebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.26.3=/ +usr/src/debug/perl-5.26.3-2 -fwrapv' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='gcc' ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE - +ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fst +ack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mn +t/share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.26.3-2 - +fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.26.3 +=/usr/src/debug/perl-5.26.3-2 -fwrapv -fno-strict-aliasing' optimize='-O3' cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE - +ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fst +ack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mn +t/share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.26.3-2 - +fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.26.3 +=/usr/src/debug/perl-5.26.3-2 -fwrapv -fno-strict-aliasing' ccversion='' gccversion='7.4.0' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='g++' ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,- +-enable-auto-image-base -fstack-protector-strong' libpth=/usr/lib libs=-lpthread -lnsl -lgdbm -ldb -ldl -lcrypt -lgdbm_compat perllibs=-lpthread -lnsl -ldl -lcrypt libc=/usr/lib/libcygwin.a so=dll useshrplib=true libperl=cygperl5_26.dll gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=dll d_dlsymun=undef ccdlflags=' ' cccdlflags=' ' lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-sy +mbols -Wl,--enable-auto-image-base -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Locally applied patches: Cygwin: README Cygwin: use auto-image-base instead of fixed DLL base address Cygwin: modify hints Cygwin: Configure correct libsearch Cygwin: Configure correct libpth Cygwin: Win32 correct UTF8 handling Perl: File-Path-2.14 (fixes CVE2017-6512) Built under cygwin Compiled at Aug 24 2019 12:22:19 %ENV: PERL5LIB="/Work/Perl/LIB" PERL5OPT="-Mstrict -Mwarnings" @INC: /Work/Perl/LIB /usr/local/lib/perl5/site_perl/5.26/x86_64-cygwin-threads /usr/local/share/perl5/site_perl/5.26 /usr/lib/perl5/vendor_perl/5.26/x86_64-cygwin-threads /usr/share/perl5/vendor_perl/5.26 /usr/lib/perl5/5.26/x86_64-cygwin-threads /usr/share/perl5/5.26


When your only tool is a hammer, all problems look like your thumb.