1 // Copyright 2023 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.base.jank_tracker; 6 7 /** 8 * A simple Data structure that holds a uptimeNanos that we wish to have data up until, and a delay 9 * to wait for this data from the Android FrameMetrics API. 10 */ 11 public final class JankEndScenarioTime { 12 public final long endScenarioTimeNs; 13 // 100ms should be long enough to receive frame metric timeline if they haven't been dropped. 14 public final long timeoutDelayMs = 100; 15 endAt(long uptimeNanos)16 public static JankEndScenarioTime endAt(long uptimeNanos) { 17 if (uptimeNanos <= 0) { 18 return null; 19 } 20 return new JankEndScenarioTime(uptimeNanos); 21 } 22 JankEndScenarioTime(long uptimeNanos)23 private JankEndScenarioTime(long uptimeNanos) { 24 endScenarioTimeNs = uptimeNanos; 25 } 26 } 27