Skip to content

Commit

Permalink
feat(rec): use microseconds instead of miliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMarble committed Mar 8, 2022
1 parent 4360c80 commit c4068b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/termsvg/rec/rec.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ func run(command string) ([]asciicast.Event, error) {
var events []asciicast.Event

p := make([]byte, readSize)
baseTime := time.Now().UnixMilli()
baseTime := time.Now().UnixMicro()

for {
n, err := ptmx.Read(p)
event := asciicast.Event{
Time: float64(time.Now().UnixMilli()-baseTime) / float64(time.Microsecond),
Time: float64(time.Now().UnixMicro()-baseTime) / float64(time.Millisecond),
EventType: asciicast.Output, EventData: string(p[:n]),
}

Expand Down

0 comments on commit c4068b5

Please sign in to comment.