Sha256: f4e2a0a0b72f2760353890ddd2dcfe850bf073594f72e3913d4f85dd441f0d61

Contents?: true

Size: 459 Bytes

Versions: 15

Compression:

Stored size: 459 Bytes

Contents

# -*- encoding: utf-8 -*-

# Benchmark speed of shell operations

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require 'tty'
require 'benchmark'
require 'benchmark/ips'
require 'stringio'

input  = ::StringIO.new
output = ::StringIO.new
shell  = TTY::Shell.new(input, output)

Benchmark.ips do |r|

  r.report("Ruby #puts") do
    output.puts "What is your name?"
  end

  r.report("TTY #ask") do
    shell.ask("What is your name?")
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tty-0.4.0 benchmarks/shell.rb
tty-0.3.2 benchmarks/shell.rb
tty-0.3.1 benchmarks/shell.rb
tty-0.3.0 benchmarks/shell.rb
tty-0.2.1 benchmarks/shell.rb
tty-0.2.0 benchmarks/shell.rb
tty-0.1.3 benchmarks/shell.rb
tty-0.1.2 benchmarks/shell.rb
tty-0.1.1 benchmarks/shell.rb
tty-0.1.0 benchmarks/shell.rb
tty-0.0.11 benchmarks/shell.rb
tty-0.0.10 benchmarks/shell.rb
tty-0.0.9 benchmarks/shell.rb
tty-0.0.8 benchmarks/shell.rb
tty-0.0.7 benchmarks/shell.rb