Demo entry 6691618

test

   

Submitted by pen on Jan 11, 2018 at 19:48
Language: Go. Code size: 247 Bytes.

package main

import (
	"fmt"
	"time"
)

var timer *time.Timer

func main() {
	timer = time.AfterFunc(time.Second, output)

	fmt.Println("done")
	time.Sleep(5 * time.Second)
}

func output() {
	stop := timer.Stop()
	fmt.Println("Invoked", stop)
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).