Skip to content

Instantly share code, notes, and snippets.

@palladin
Created September 22, 2012 10:35
Show Gist options
  • Save palladin/3765785 to your computer and use it in GitHub Desktop.
Save palladin/3765785 to your computer and use it in GitHub Desktop.
raise vs Async.Raise
type Microsoft.FSharp.Control.Async with
static member Raise (e : #exn) = Async.FromContinuations(fun (_,econt,_) -> econt e)
#time
for i in [|1..1000000|] do
try
raise <| new System.Exception()
with ex -> ()
async {
for i in [|1..1000000|] do
try
return! Async.Raise <| new System.Exception()
with ex -> ()
} |> Async.RunSynchronously
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment