curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler
https://github.com/curiosity-ai/h5
Apache License 2.0
211 stars 30 forks source link

Add console timing functions for benchmarking. #36

Closed IceReaper closed 3 years ago

IceReaper commented 3 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Console/time Would be nice to have the three time related functions available :)

theolivenbaum commented 3 years ago

Hi @IceReaper - you can already access them in the dom console (which is not the same as the System.Console class)

using static H5.Core.dom;

// ....

console.time("Time this");

for (var i = 0; i < 10000; i++) {
  // Your stuff here
}

console.timeEnd("Time this");