Created
March 8, 2020 20:40
-
-
Save Freaky/36c36633c9a6c5fa32999e69fa9ed488 to your computer and use it in GitHub Desktop.
Sort timings from https://esham.io/2018/02/zsh-profiling
This file contains 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 characters
#!/usr/bin/env ruby | |
times = ARGF | |
.each_line | |
.map { |line| /^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.{1,77})/.match(line) } | |
.select(&:itself) | |
.map { |md| [Integer(md[1] + md[2]), md[3]] } | |
.each_cons(2) | |
.map { |a, b| [b[0] - a[0], a[1]]} | |
.sort_by(&:first) | |
puts times.map { |t| t.join(" ") }.reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment