Skip to content

Commit

Permalink
status: add timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
gerryd committed Oct 21, 2023
1 parent 4bf1247 commit 0a7b3d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ type outputData struct {
Width int `json:"width"`
Height int `json:"height"`
Signal string `json:"signal"`
Time int64 `json:"time"`
}

func (s *StatusCmd) Run(c *Context) error {
next := true

for next {
output := &outputData{}
output.Time = time.Now().UnixMilli()

buf := readmem(c, Region { Region: "RAM", Addr: 0x0000e180 }, 16)

Expand Down Expand Up @@ -73,9 +75,8 @@ func (s *StatusCmd) Run(c *Context) error {
if (s.Json) {
data, _ := json.Marshal(output)
p = string(data)

} else {
p = fmt.Sprintf("width: %d\nheight: %d\nsignal: %s\n", output.Width, output.Height, output.Signal)
p = fmt.Sprintf("time: %d\nwidth: %d\nheight: %d\nsignal: %s\n", output.Time, output.Width, output.Height, output.Signal)
}

if (s.Filename == "") {
Expand Down

0 comments on commit 0a7b3d4

Please sign in to comment.