core
core copied to clipboard
Added Debug.logTime function for easier performance debugging
This lets you "tag" any function for easy performance debugging. More info in this discourse thread.
Wrap any function in your code:

This will log the execution time in the console:

It is also visible in the performance timeline:

I was thinking about renaming this function to Debug.benchmark instead, is that better?
Considering that this addition will take a long time to be included in an official package; how do you build this core package and include it in your environment?
The way I use this locally is
- Replace the
Debug.elmmodule somewhere in~/.elm/packagesor wherever they are located on your system (I use Linux) - Remove the
*.datfiles in the core module (found in the parent dir to where Debug.elm is located) - Remove
elm-stuffin my project.
Then you should be able to use Debug.logTime in your project. Probably there is a better way to do this but it works on my computer ;-)
It compiles! That's excellent. Lifesaver!
So someone should at some point be making an "illegal" package manager for Elm that applies and unapplies core patches such as your excellent one.