From the course: Automated Testing in Xcode

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Measuring performance

Measuring performance

- [Instructor] In this lesson, we're going to talk about measuring the performance of our unit tests. And in particular, these are very helpful when you're working with UI tests, because you can make sure that things are appearing in a timely fashion. So what we're going to do here is I'm going to create a function at the bottom of our Pixelford UI test class, and we're going to call it func test performance. In this test function, what I'm going to do is called self.measure. And inside, what happens when you call measure is that it executes a block of code that you want to have ran over and over again. In fact, it runs it ten times. So what I want to do is use the same sequence that we had created in our measurement test. So what I want to do is come over here to testRecord. I'm going to select some of our code, and we're going to work with it. I'm going to highlight from line 45 to line 60. We don't necessarily need the expectations, we just want to get this block of code here that…

Contents