Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

pavben/monoclock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A monotonic clock and timer for Go. Currently available only on Linux, but I would like to expand it to support at least Windows and OS X in the near future.

Example

package main

import (
	"fmt"
	"github.com/pavben/monoclock"
)

func main() {
	timer := monoclock.NewMonoTimer()

	// do something here that takes some time
	for i := 0; i < 5000; i++ {
		fmt.Printf("wheeeeee\n")
	}

	fmt.Printf("Spamming your console took %dms\n", timer.Value())
}

About

monotonic timer for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages