8000 GitHub - gmodx/timer at v0.0.4
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.
/ timer Public archive

The timer package provides a simple way to schedule and execute functions at specified intervals.

License

Notifications You must be signed in to change notification settings

gmodx/timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timer

Go Reference

The timer package provides a simple way to schedule and execute functions at specified intervals.

Installation

To use this package in your Go project, you can install it using go get:

go get github.com/gmodx/timer

Usage

Here's a basic example 64D0 of how to use the timer package to schedule and execute functions at specified intervals:

package main

import (
	"fmt"
	"github.com/gmodx/timer"
	"time"
)

func main() {
	// Define a function to be executed.
	jobFunc := func(message string) {
		fmt.Println("Job executed:", message)
	}

	// Schedule the function to be executed every 2 seconds with a 1-second delay.
	err := timer.Tick(time.Second, 2*time.Second, jobFunc, "Hello, World!")
	if err != nil {
		fmt.Println("Error:", err)
	}

	// Keep the program running for demonstration purposes.
	select {}
}

Documentation

For more information and usage examples, please refer to the GoDoc documentation.

About

The timer package provides a simple way to schedule and execute functions at specified intervals.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0