Package timer

import "github.com/byte-mug/golang-rlogc/timer"

Overview

Timer implementations for RlogC

Index

func Increment

func Increment() rlogc.Timer

A pseudo-timer, that increases every time it is called.

func Interval

func Interval(d time.Duration) rlogc.Timer

A monotonic timer that increases in a given interval.

Calls to this function are cheap, because it only fetches a field of a struct that is incremented by a goroutine, that runs in background.

WARNING: this function creates a goroutine, that won't stop! Do only call this a bounded number of times!

func Seconds

func Seconds() rlogc.Timer

A monotonic timer, that increases once every second.

Calls to this function are somewhat expensive, because this function calls

time.Now().Unix()

Dependencies