2022-09-15 11:17:19 +00:00
|
|
|
module type BenchmarkTopic = {
|
2022-09-19 11:00:38 +00:00
|
|
|
let runAll: unit => unit
|
2022-09-15 11:17:19 +00:00
|
|
|
}
|
|
|
|
|
2022-09-19 11:00:38 +00:00
|
|
|
let measure = (name: string, f: unit => unit) => {
|
|
|
|
let start = Js.Date.make()->Js.Date.valueOf
|
|
|
|
f()
|
|
|
|
let end = Js.Date.make()->Js.Date.valueOf
|
|
|
|
let duration = (end -. start) /. 1000.
|
|
|
|
Js.log2(duration, name)
|
2022-09-15 11:17:19 +00:00
|
|
|
}
|