Created
August 1, 2018 07:31
-
-
Save manofstick/20ac739756c2063a0a2910e388622866 to your computer and use it in GitHub Desktop.
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.Diagnostics | |
for i = 1 to 5 do | |
let data = | |
let r = Random i | |
Array.init 2500 (fun _ -> | |
Seq.init (r.Next 50) (fun _ -> r.Next 3) | |
|> Set.ofSeq) | |
let sw = Stopwatch.StartNew () | |
let mutable count = 0 | |
for a in data do | |
for b in data do | |
if a < b then count <- count + 1 | |
printfn "%d (%d)" sw.ElapsedMilliseconds count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment