Skip to content

Instantly share code, notes, and snippets.

View aschmied's full-sized avatar

Anthony Schmieder aschmied

View GitHub Profile
@aschmied
aschmied / prof.rb
Last active April 17, 2018 16:03
Profile a block in JRuby
# Remember to pass `--profile.api` to JRuby:
# jruby --profile.api prof.rb
require "jruby/profiler"
def main
prof = JRuby::Profiler.profile do
puts(f1)
puts(f2)
end
@aschmied
aschmied / timeIt.swift
Created December 30, 2014 21:46
Time code execution in Swift
func timeIt(function: ()->()) -> Double {
var startTime = NSDate()
function()
return -startTime.timeIntervalSinceNow
}
let N = 800
var B = [Float](count: N, repeatedValue: 0)
elapsed = timeIt({