Perform sec to msec upconversion before first printout

This commit is contained in:
Andreas Baulig 2021-08-18 21:01:12 +00:00
parent d158c2776e
commit fa66bf0160
No known key found for this signature in database
GPG Key ID: 5225DCE5A4A2EE20
1 changed files with 5 additions and 2 deletions

View File

@ -130,6 +130,11 @@ func main() {
// make a read buffer
reader := bufio.NewReader(fi)
var headerOrigin HeaderStd = analyze(reader)
if !*assumeMilliseconds {
headerOrigin.StartTimestamp = headerOrigin.StartTimestamp * (int64(time.Second) / int64(time.Millisecond))
}
printHeader(&headerOrigin)
if flagSeen["out"] {
@ -157,8 +162,6 @@ func main() {
}
} else if *timeNow {
headerOrigin.StartTimestamp = int64(time.Now().UnixNano() / int64(time.Millisecond))
} else if !*assumeMilliseconds {
headerOrigin.StartTimestamp = headerOrigin.StartTimestamp * (int64(time.Second) / int64(time.Millisecond))
}
fmt.Println("\nHeader is now")