Skip to content

Instantly share code, notes, and snippets.

@kos59125
Created September 6, 2012 10:00
Show Gist options
  • Save kos59125/3654188 to your computer and use it in GitHub Desktop.
Save kos59125/3654188 to your computer and use it in GitHub Desktop.
同じことを n 回繰り返す
let invoke action = action ()
let repeat n action = Seq.initInfinite (fun _ -> action) |> Seq.take n |> Seq.iter invoke
let slowPrint (delay : int) =
fun () ->
System.Threading.Thread.Sleep (delay)
System.Console.WriteLine (System.DateTime.Now)
slowPrint 500 |> repeat 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment