Skip to content

Instantly share code, notes, and snippets.

@ulian-onua
Last active March 3, 2019 19:12
Show Gist options
  • Save ulian-onua/14ad965fb74809d43af3feaae664eb36 to your computer and use it in GitHub Desktop.
Save ulian-onua/14ad965fb74809d43af3feaae664eb36 to your computer and use it in GitHub Desktop.
UIColor_native_initializer_tests.swift
import XCTest
class UIColorNativeTests: XCTestCase {
var computedNativeColor: UIColor {
return UIColor(red: 224.0 / 255.0,
green: 17.0 / 255.0,
blue: 95.0 / 255.0,
alpha: 1.0)
}
func testShortLoop() {
measure {
for _ in 0..<TestConstants.shortLoopCount {
let _ = computedNativeColor
}
}
}
func testMediumLoop() {
measure {
for _ in 0..<TestConstants.mediumLoopCount {
let _ = computedNativeColor
}
}
}
func testLongLoop() {
measure {
for _ in 0..<TestConstants.longLoopCount {
let _ = computedNativeColor
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment