Skip to content

Commit 6134cde

Browse files
author
Gonzalo Diaz
committed
[CONFIG] Makefile new function to measure the time.
1 parent ce5faed commit 6134cde

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@ PACKAGE_MANAGER=cargo
3030
# CGO_ENABLED=0
3131

3232
.MAIN: test/coverage
33-
.PHONY: all clean coverage dependencies help list test
33+
.PHONY: all build clean coverage dependencies env format help list test
3434
.EXPORT_ALL_VARIABLES: # (2)
3535

36+
define crono
37+
@start=$$(date +%s); \
38+
$(1); \
39+
end=$$(date +%s); \
40+
diff=$$((end - start)); \
41+
printf "Total time: %02d:%02d:%02d\n" $$((diff/3600)) $$((diff%3600/60)) $$((diff%60))
42+
endef
43+
44+
3645
help: list
3746

3847
list:
@@ -137,7 +146,8 @@ compose/test: compose/build
137146
compose/run: compose/build
138147
${DOCKER_COMPOSE} --profile production run --rm algorithm-exercises-rust
139148

140-
all: test coverage
149+
all:
150+
$(call crono, make clean; make dependencies; make build; make test; make lint; make coverage/html)
141151

142152
run:
143153
ls -alh

0 commit comments

Comments
 (0)