
エントリーの編集

エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
高速なのは Range#cover? or Range#include? or ActiveSupport::TimeWithZone#between? それとも? - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています

- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
高速なのは Range#cover? or Range#include? or ActiveSupport::TimeWithZone#between? それとも? - Qiita
require 'bundler/setup' require 'benchmark_driver' Benchmark.driver do |x| x.prelude <<~RUBY requ... require 'bundler/setup' require 'benchmark_driver' Benchmark.driver do |x| x.prelude <<~RUBY require 'active_support/time' t = Time.current + 5.minutes RUBY x.report 'include?', %[ (Time.current..Float::INFINITY).include?(t) ] x.report 'cover?', %[ (Time.current..Float::INFINITY).cover?(t) ] x.report 'between?', %[ t.between?(Time.current, Float::INFINITY) ] x.report 'raw_function', %[ t >= Time.c