Skip to content

Instantly share code, notes, and snippets.

@manofstick
Created August 1, 2018 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manofstick/20ac739756c2063a0a2910e388622866 to your computer and use it in GitHub Desktop.
Save manofstick/20ac739756c2063a0a2910e388622866 to your computer and use it in GitHub Desktop.
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