A quick and dirty helper function:

1
2
3
4
5
6
7
8
    let runEveryMinute action =
        let rec loop() = 
            async {
                do action()
                do! Async.Sleep 60000
                do! loop()    
            }
        loop() |> Async.Start

Starts an asynchronous loop executing the parameter function immediately then waits a minute and recurses.

If you want more precision, you can calculate how much milliseconds to sleep until the next full minute.

By on 10/28/2014 7:19 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper