⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (215 Bytes)
Bug #12373
» string-start_with.rb
ksss (Yuki Kurihara)
, 05/12/2016 12:39 AM
#! /usr/bin/env ruby
require
'benchmark/ips'
a
=
"abcdefg"
b
=
'"'
Benchmark
.
ips
do
|
x
|
x
.
report
(
"a[0] == b"
)
do
a
[
0
]
==
b
end
x
.
report
(
"a.start_with?(b)"
)
do
a
.
start_with?
(
b
)
end
x
.
compare!
end
« Previous
1
2
3
4
5
6
…
9
Next »
(4-4/9)
Loading...