An open API service indexing awesome lists of open source software.

https://github.com/wmentor/latency

Latency time calc
https://github.com/wmentor/latency

calc-time go golang golang-library latency time work-time

Last synced: 7 months ago
JSON representation

Latency time calc

Awesome Lists containing this project

README

          

Simple calc latency library

# Summary

* Very simple
* Written on tiny Go
* Require Go version >= 1.8
* No external dependencies

# Install

```
go get github.com/wmentor/latency
```

# Usage

```
package main

import (
"fmt"
"time"

"github.com/wmentor/latency"
)

func main() {

l := latency.New()

time.Sleep(time.Millisecond * 10)

fmt.Printf("latency=%.3f\n", l.Seconds()) // like 0.01...

time.Sleep(time.Millisecond * 160)

fmt.Printf("latency=%.3f\n", l.Seconds()) // like 0.17...

l.Duration() // time.Duration
}
```