Sanchime.Learn/Algrithms/Sorts/Test.fs

24 lines
582 B
Forth

namespace Sanchime.Algrithm.Sort
open System.Diagnostics
module Test =
let test sort =
try
let rand = System.Random() in
let list = List.init 10000 (fun _ -> rand.Next(-10000,10000))
printfn "原序列:%A" list
let watch = new Stopwatch();
watch.Start();
let res = list |> sort ( <= )
res |> printfn "排序后:%A"
watch.Stop();
printfn "耗时(毫秒):%A" watch.Elapsed.TotalMilliseconds
with
| ex -> printfn "%A" ex