Fractional seconds need leading 0s and all 9 digits

Changed timestamp output format to one that can be easily parsed
Added flush after each anomaly to stop pipes from buffering output
This commit is contained in:
Andrew Johnson
2003-06-27 15:06:46 +00:00
parent 6463589276
commit 5f61e9c2fc

View File

@@ -247,7 +247,7 @@ int main ( int argc, char ** argv )
if ( anomaly ) {
char date[64];
currentTime.strftime ( date, sizeof ( date ),
"%a %b %d %Y %H:%M:%S.%f");
"%Y-%m-%d %T.%09f");
char host[64];
ipAddrToA ( &ina, host, sizeof ( host ) );
printf ( "%-40s %s\n",
@@ -256,6 +256,7 @@ int main ( int argc, char ** argv )
printf ( "\testimate=%f current=%f\n",
pBHE->period (), currentTime - previousTime );
}
fflush(stdout);
}
}
else {