This language bar is your friend. Select your favorite languages!

Idiom #185 Execute function in 30 seconds

Schedule the execution of f(42) in 30 seconds.

let id = window.setTimeout(f, 30000, 42);
import  "time"
timer := time.AfterFunc(
	30*time.Second,
	func() {
		f(42)
	})
import  "time"
go func() {
	time.Sleep(3 * time.Second)
	f(42)
}()

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org

Related idioms