Skip to content

Instantly share code, notes, and snippets.

@landy
Created November 4, 2022 11:45
Show Gist options
  • Save landy/448d2ff4a9b615d7442ddbaae2e1d145 to your computer and use it in GitHub Desktop.
Save landy/448d2ff4a9b615d7442ddbaae2e1d145 to your computer and use it in GitHub Desktop.
let exampleTask = Task.FromResult("I'm great developer.");
let getStringWithAsyncCore () = task {
return! exampleTask
}
[<Benchmark>]
let getStringWithAsync () = task {
return! getStringWithAsyncCore()
}
let getStringWithoutAsyncCore () =
exampleTask
[<Benchmark>]
let getStringWithoutAsync () = task {
return getStringWithoutAsyncCore ()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment