New version of “grunt-timer”
Open source is a great way to get software tested. Thanks to issues logged against the grunt-timer github repository, I’ve now made several improvements and fixes:
Tasks (that aren’t really tasks) taking no time are no longer logged.
- Let’s say you have a task “mytask” that has a “mytask:dist” configuration. “mytask:dist” is actually what should be timed (according to the “nameArgs” property). Therefore I have omitted tasks that take 2ms or less from the output. This was a serious issue with the previous version.
A total elapsed time of all logged tasks is now also logged.
- By adding a high intensity summary output at the end, it makes is more obvious that the the last entry isn’t itself a summary. It still has to appear after the “Done, without errors” unfortunately, due to the way the hooking for the task name change works. *Please let me know if you can see a way around this
The initialisation period no longer contributes to logged times.
- i.e. The time that is elapsed before your tasks are actually run (which is minimal) is not output, nor is it part of the summary. I decided that this initialisation time was irrelevant and only confusing the results.
The full source code is available here. I’m open to pull requests and suggestions as always.