File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,14 @@ defmodule Mix.CLI do
88 Mix . start ( )
99
1010 if env_variable_activated? ( "MIX_QUIET" ) , do: Mix . shell ( Mix.Shell.Quiet )
11- if env_variable_activated? ( "MIX_DEBUG" ) , do: Mix . debug ( true )
11+
12+ debug? =
13+ if env_variable_activated? ( "MIX_DEBUG" ) do
14+ Mix . debug ( true )
15+ true
16+ else
17+ false
18+ end
1219
1320 if profile = System . get_env ( "MIX_PROFILE" ) do
1421 Mix.State . put ( :profile , String . split ( profile , "," ) )
@@ -22,6 +29,13 @@ defmodule Mix.CLI do
2229 :version ->
2330 display_version ( )
2431
32+ nil when debug? ->
33+ shell = Mix . shell ( )
34+ shell . info ( "-> Running mix CLI" )
35+ { time , res } = :timer . tc ( & proceed / 1 , [ args ] )
36+ shell . info ( [ "<- Ran mix CLI in " , Integer . to_string ( div ( time , 1000 ) ) , "ms" ] )
37+ res
38+
2539 nil ->
2640 proceed ( args )
2741 end
Original file line number Diff line number Diff line change @@ -523,7 +523,7 @@ defmodule Mix.Task do
523523 task in Mix.State . get ( :profile , [ ] ) ->
524524 shell = Mix . shell ( )
525525 shell . info ( [ "-> Profiling mix " , task_to_string ( task , args ) , project_to_string ( proj ) ] )
526- Mix.Tasks.Profile.Eprof . profile ( fun , warmup: false , set_on_spawn: false )
526+ Mix.Tasks.Profile.Tprof . profile ( fun , warmup: false , set_on_spawn: false )
527527
528528 true ->
529529 fun . ( )
You can’t perform that action at this time.
0 commit comments