File: parse-date

package info (click to toggle)
jekyll 4.3.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,356 kB
  • sloc: ruby: 16,765; javascript: 1,455; sh: 214; xml: 29; makefile: 9
file content (25 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env ruby

require_relative '../lib/jekyll'
require 'benchmark/ips'

date = "2014-08-02 14:43:06 PDT".freeze
time = Time.parse(date)

Benchmark.ips do |x|
  x.report('Time.parse') do
    Time.parse(date)
  end

  x.report('localtime') do
    Time.parse(date).localtime
  end

  x.report('localtime parsed') do
    time.localtime
  end

  x.report('Utils.parse_date') do
    Jekyll::Utils.parse_date(date)
  end
end