Measure time of execution in F#

后端 未结 4 789
走了就别回头了
走了就别回头了 2021-01-01 10:30

Please post code for displaying time in F#. I noticed that you can measure it from F# interactive with #time directive, but I don\'t know how to execute program from FSI

4条回答
  •  一整个雨季
    2021-01-01 11:17

    You could also create custom computation expression to hide actual measuring logic, e.g.:

    timer {
       // your code goes here
    }
    

    See more examples here: https://fsharpforfunandprofit.com/posts/computation-expressions-bind/

提交回复
热议问题