GithubHelp home page GithubHelp logo

filinvadim / wall-clock-ticker Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 14 KB

Golang wall clocks ticker

License: BSD 2-Clause "Simplified" License

Go 100.00%
golang golang-library wall wall-clock wallclock wall-clock-ticker

wall-clock-ticker's Introduction

golang-action status

wall-clock-ticker

Golang wall clock ticker is a Go library that provides a ticker which ticks according to wall clock.

Installation

go get -u github.com/filinvadim/wall-clock-ticker

Usage

Using Golang wall clock ticker is very much like time.NewTicker with the addition of an accuracy and start time.

The following creates a ticker which ticks on the minute according the hosts wall clock with an accuracy of plus or minus one second.

package main

import (
	"fmt"
	"time"

	wct "github.com/filinvadim/wall-clock-ticker"
)

func main() {
	// ticks every 59th minute of every hour
	t := wct.NewWCTicker(time.Minute*59, time.Second)
	for tick := range t.C {
		// Process tick
		fmt.Println("tick:", tick)
	}
}

License

Golang wall clock ticker is available under the BSD 2-Clause License.

wall-clock-ticker's People

Contributors

filinvadim avatar

Stargazers

 avatar  avatar

Watchers

 avatar

wall-clock-ticker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.