The most minimal way to do this is probably
julia> push!(Base.active_repl_backend.ast_transforms, ast -> :(t = time(); r = $(ast); Base.eval(Main, :(last_time = $(time() - t))); r))
2-element Vector{Any}:
softscope (generic function with 1 method)
#7 (generic function with 1 method)
julia> sleep(2)
julia> last_time
2.0292770862579346