Created
February 20, 2024 22:22
-
-
Save exterm/a915f6cd51f4a9a8d6c9f893965436fc to your computer and use it in GitHub Desktop.
Revisions
-
exterm created this gist
Feb 20, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ # add to config/boot.rb require "benchmark" $require_nesting = -1 def require(file_name) result = nil $require_nesting += 1 time = Benchmark.realtime do result = super end if result if time > 0.2 indentation = "=" * $require_nesting puts indentation + "> #{time} #{file_name}" # else # indentation = "-" * $require_nesting # puts indentation + "> #{time} #{file_name}" end end $require_nesting -= 1 result end