Times the execution of a given target and report the duration with milliseconds precision.
The following variables will be populated:
stdlib.vars.timed.begin-ts.TARGET_NAME
(nanos)`stdlib.vars.timed.end-ts.TARGET_NAME
(nanos)`stdlib.vars.timed.duration.TARGET_NAME
(millis)`
Makefile:
my-target :
@sleep 2
@echo 😴 I slept for 2 seconds.
Shell:
$ make my-target!bmakelib.timed
Using default value 'yes' for variable 'stdlib.conf.timed.SILENT'
😴 I slept for 2 seconds.
Target 'my-target' took 2009ms to complete.
Makefile:
some-target :
@sleep 2
my-target : stdlib.conf.timed.SILENT = yes
my-target : some-target!bmakelib.timed
@echo ✅ Made some-target in $(stdlib.vars.timed.duration.some-target)ms 🙌
Shell:
$ make my-target
✅ Made some-target in 2008ms 🙌
See !timed
below for a shorter name.
Whether to define the convenience target !timed
.
Set to 'no' before including bmakelib to disable.
Convenice target with a shorter and more intuitive name. It's a drop-in replacement for
!bmakelib.timed
.
Lets you write
some-target : other-target!timed
or
$ make my-target!timed
See also bmakelib.conf.timed.convenience-target
.
If set to yes, causes !bmakelib.timed
to emit an info containing the duration of the target.