LoginSignup
1
1

More than 1 year has passed since last update.

XCTMemoryMetricが動かない場合のワークアラウンド

Posted at

XCTestでは、measureを使うと使用メモリや実行時間を計測できるが実行時間以外のメトリクスはうまく動いてくれない。

final class MeasureTests: XCTestCase {
    func testSingleContextLayer() {
        measure(metrics: [XCTMemoryMetric(), XCTClockMetric()]) {
        }
    }
}

どうもiOSシミュレータでは動いてくれないようなので、実行ターゲットをMacにすると使えるようになる。

CleanShot 2022-08-14 at 02.13.29@2x.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1