Subtract and Echo Difference of Variables in GNU Make
Clash Royale CLAN TAG #URR8PPP Subtract and Echo Difference of Variables in GNU Make I'm echoing the time before I run a task and the time that task ends: test: @echo $(shell date) @JUNIT_REPORT_PATH=test/report.xml ./node_modules/.bin/mocha test/integration @echo $(shell date) Is there a way to store the dates in 2 variables and then show the elapsed time between them? I assume it would look something like this: test: @echo $(shell date) @JUNIT_REPORT_PATH=test/report.xml ./node_modules/.bin/mocha test/integration @echo $(shell date) test: $begin = $(shell date) <do stuff> $end = $(shell date) @echo $end - $begin Any pointers to good documentation on Make would be appreciated too. Thanks! 3 Answers 3 Short answer: what you want is possible: test: @begin=$$(date +%s); <do stuff in same shell: do not forget the ";" and the "...