Skip to content

Benchmarkの追加 #4

@gazayas

Description

@gazayas

アルゴリズムはプログラムを速くするために使われるのでbenchmarkで比較したい

require 'benchmark'
require 'insertion_sort'

ary = [4, 8, 3, 2, 9, 1, 5, 10, 7, 6]

Benchmark.bm 100 do |r|
  r.report "Insertion sort 挿入ソート" do
    insertion_sort(ary)
  end
  # その他のアルゴリズム
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions