title: a timeit function for F#
body: <p>I am trying to write something like</p>
  
  <pre><code>let timeit (x:'a-&gt;'b) =
      let start = System.DateTime.Now
      x
      let duration = System.DateTime.Now - start
      printfn "time usage = %A" duration.Milliseconds 
      ()
  </code></pre>
  
  <p>it works for </p>
  
  <pre><code>let matrixtest() =
      let x = vector[1.;2.;4.]
      let y = matrix[[1.;2.;4.;];[3.;4.;9.;]]
      printfn "%A" (y * x)
      ()
  </code></pre>
  
  <p>but not for</p>
  
  <pre><code>let rec fib x = 
          match x with
          | 0 | 1 -&gt; 1
          | n -&gt; fib (n-1) + fib (n-2)
  </code></pre>
  
  <p>sa F# is static typed.</p>
  
  <p>Any idea? Thanks.</p>