Comment

Comment by fleitz

TickCount has 1 millisecond accuray and it's actually milliseconds, which is what tipped me off to the low numbers. It actually takes 140 milliseconds to execute. I redid the code to not use Seqs and now it's down to 15 ms.

  // Learn more about F# at http://fsharp.net
  open System

  let consume x = ()
  let start = System.Environment.TickCount
  let arr = [| 1..4 |] 
  for i = 1 to 100000 do
    arr
    |> Array.filter (fun y -> (y % 2) = 0) 
    |> consume 

  let endTime = System.Environment.TickCount
  printf "%d milliseconds" (endTime - start)
parent fleitz 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton