This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@discardableResult | |
func measure<A>(name: String = "", _ block: () -> A) -> A { | |
let startTime = CACurrentMediaTime() | |
let result = block() | |
let timeElapsed = CACurrentMediaTime() - startTime | |
print("Time: \(name) - \(timeElapsed)") | |
return result | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let start = CFAbsoluteTimeGetCurrent() | |
// run your work | |
let diff = CFAbsoluteTimeGetCurrent() - start | |
print("Took \(diff) seconds") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node{ | |
timestamps{ | |
stage('Samples'){ | |
// Single quotes with no interpolation, at least not in Jenkins. | |
// The dollar variable will be evaluated before being run by the | |
// shell command, so variables which Jenkins makes available as | |
// environment variables can still be accessed from within a | |
// single-quoted string, passed to the sh task. | |
sh 'echo $PATH' |
OlderNewer