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
- Host: GitHub
- URL: https://github.com/wmentor/latency
- Owner: wmentor
- License: mit
- Created: 2020-07-01T17:48:04.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-01T18:07:52.000Z (almost 6 years ago)
- Last Synced: 2025-03-04T01:44:35.199Z (over 1 year ago)
- Topics: calc-time, go, golang, golang-library, latency, time, work-time
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
}
```