Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import UIKit
  2. import XCTest
  3.  
  4. extension XCTestCase {
  5. func measure(count: UInt, _ block: () -> Void) {
  6. measure {
  7. (0..<count).forEach { _ in
  8. block()
  9. }
  10. }
  11. }
  12. }
  13.  
  14. class Test: XCTestCase {
  15. private let count: UInt = 1000
  16.  
  17. func testA() {
  18. measure(count: count) {
  19. // test code here
  20. }
  21. }
  22.  
  23. func testB() {
  24. measure(count: count) {
  25. // test code here
  26. }
  27. }
  28. }
  29.  
  30. Test.defaultTestSuite.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement