ruby/lib/irb
aycabta 9f08e3c703 [ruby/irb] Add measure command
You can use "measure" command to check performance in IRB like below:

  irb(main):001:0> 3
  => 3
  irb(main):002:0> measure
  TIME is added.
  => nil
  irb(main):003:0> 3
  processing time: 0.000058s
  => 3
  irb(main):004:0> measure :off
  => nil
  irb(main):005:0> 3
  => 3

You can set "measure :on" by "IRB.conf[:MEASURE] = true" in .irbrc, and, also,
set custom performance check method:

  IRB.conf[:MEASURE_PROC][:CUSTOM] = proc { |context, code, line_no, &block|
    time = Time.now
    result = block.()
    now = Time.now
    puts 'custom processing time: %fs' % (Time.now - time) if IRB.conf[:MEASURE]
    result
  }

3899eaf2e2
2020-12-20 16:23:59 +09:00
..
cmd [ruby/irb] Add measure command 2020-12-20 16:23:59 +09:00
ext [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
lc [ruby/irb] Exclude useless files from RDoc 2020-02-01 17:03:59 +09:00
.document [ruby/irb] Exclude useless files from RDoc 2020-02-01 17:03:59 +09:00
color.rb [ruby/irb] Directly check if the method is available instead of version 2020-08-18 14:38:01 +09:00
completion.rb Revert "Prefer #send over #__send__ when it is clear there is no possible conflict" 2020-11-05 20:54:34 +09:00
context.rb [ruby/irb] Drop OMIT_ON_ASSIGNMENT and add :truncate option for ECHO_ON_ASSIGNMENT 2020-09-19 05:13:08 +09:00
easter-egg.rb Revert "Prefer #send over #__send__ when it is clear there is no possible conflict" 2020-11-05 20:54:34 +09:00
extend-command.rb [ruby/irb] Add measure command 2020-12-20 16:23:59 +09:00
frame.rb Remove e2mmap dependency 2019-11-25 05:38:09 +09:00
help.rb [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
init.rb [ruby/irb] Add measure command 2020-12-20 16:23:59 +09:00
input-method.rb [ruby/irb] Add OMIT_ON_ASSIGNMENT 2020-09-14 02:13:11 +09:00
inspector.rb [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
irb.gemspec [ruby/irb] Need calculate_width and split_by_width of Reline::Unicode of reline 0.1.5 or later 2020-09-14 02:13:32 +09:00
locale.rb Use Reline.encoding_system_needs if exists 2020-01-14 15:40:38 +09:00
magic-file.rb Don't pollute toplevel by an IRB internal method 2017-06-15 10:43:17 +00:00
notifier.rb Remove e2mmap dependency 2019-11-25 05:38:09 +09:00
output-method.rb Remove e2mmap dependency 2019-11-25 05:38:09 +09:00
ruby-lex.rb [ruby/irb] Handle rest of tokens correctly if no newline at last 2020-12-20 16:23:58 +09:00
ruby_logo.aa [ruby/irb] Discard newlines at end of file 2020-08-28 11:05:18 +09:00
src_encoding.rb Don't pollute toplevel by an IRB internal method 2017-06-15 10:43:17 +00:00
version.rb [ruby/irb] Version 1.2.7 2020-09-19 05:13:08 +09:00
workspace.rb [ruby/irb] Change context-mode's default to new mode 4. 2020-12-17 20:24:08 +09:00
ws-for-case-2.rb
xmp.rb [ruby/irb] Prefer require_relative to load the files in this library 2020-08-18 14:38:01 +09:00