Created
April 26, 2023 17:35
-
-
Save avestura/9706a7f7040f3aa0640e29c7bb1fb7e1 to your computer and use it in GitHub Desktop.
CPU Affinity Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Linq | |
open System.Diagnostics | |
// change cpu affinity while app is running | |
// run in debug mode: optimizations off | |
printfn "Press enter to continue" | |
Console.ReadKey () |> ignore | |
let f x = x | |
for i in 0..10_000_000 do | |
let sw = Stopwatch() | |
sw.Start() | |
for j in 0..1000_000_000 do | |
f j |> ignore | |
sw.Stop() | |
printfn "round %i done, took %d ms" i sw.ElapsedMilliseconds | |
printfn "Hello from F#" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment