Home
last modified time | relevance | path

Searched refs:timer (Results 1 – 25 of 40) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DBatteryStatsDurationTimerTest.java41 final BatteryStatsImpl.DurationTimer timer = new BatteryStatsImpl.DurationTimer(clocks, in testStartStop() local
46 assertFalse(timer.isRunningLocked()); in testStartStop()
47 assertEquals(0, timer.getCurrentDurationMsLocked(300)); in testStartStop()
48 assertEquals(0, timer.getMaxDurationMsLocked(301)); in testStartStop()
49 assertEquals(0, timer.getTotalDurationMsLocked(301)); in testStartStop()
52 timer.startRunningLocked(700); in testStartStop()
53 assertTrue(timer.isRunningLocked()); in testStartStop()
54 assertEquals(800, timer.getCurrentDurationMsLocked(1500)); in testStartStop()
55 assertEquals(801, timer.getMaxDurationMsLocked(1501)); in testStartStop()
56 assertEquals(802, timer.getTotalDurationMsLocked(1502)); in testStartStop()
[all …]
DBatteryStatsSamplingTimerTest.java33 final BatteryStatsImpl.SamplingTimer timer = new BatteryStatsImpl.SamplingTimer(clocks, in testSettingStalePreservesData() local
36 timer.onTimeStarted(100, 100, 100); in testSettingStalePreservesData()
39 timer.update(10, 1); in testSettingStalePreservesData()
41 timer.update(20, 2); in testSettingStalePreservesData()
43 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
44 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
46 timer.endSample(); in testSettingStalePreservesData()
48 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
49 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED)); in testSettingStalePreservesData()
51 timer.onTimeStopped(200, 200, 200); in testSettingStalePreservesData()
[all …]
DBatteryStatsStopwatchTimerTest.java37 final BatteryStatsImpl.StopwatchTimer timer = new BatteryStatsImpl.StopwatchTimer(clocks, in testCount() local
45 timer.startRunningLocked(updateTime(clocks, 100)); // start in testCount()
47 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
48 timer.startRunningLocked(updateTime(clocks, 110)); // start in testCount()
49 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
50 timer.stopRunningLocked(updateTime(clocks, 120)); // stop in testCount()
51 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
52 timer.stopRunningLocked(updateTime(clocks, 130)); // stop in testCount()
53 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED)); in testCount()
56 timer.startRunningLocked(updateTime(clocks, 200)); // start in testCount()
[all …]
DBatteryStatsTimerTest.java95 TestTimer timer = new TestTimer(clocks, 0, timeBase); in testRunning() local
96 timer.nextComputeCurrentCount = 3000; in testRunning()
99 timer.nextComputeRunTime = 4; in testRunning()
100 timer.onTimeStarted(10, 20, 50); in testRunning()
101 timer.nextComputeRunTime = 17; in testRunning()
102 timer.onTimeStopped(100, 130, 170); in testRunning()
103 Assert.assertEquals(170, timer.lastComputeRunTimeRealtime); in testRunning()
104 Assert.assertEquals(17, timer.getTotalTime()); in testRunning()
105 Assert.assertEquals(3000, timer.getCount()); in testRunning()
161 TestTimer timer = new TestTimer(clocks, 0, timeBase); in testResetNoDetach() local
[all …]
DBatteryStatsDualTimerTest.java40 final BatteryStatsImpl.DualTimer timer = new BatteryStatsImpl.DualTimer(clocks, in testResetDetach() local
43 assertTrue(timeBase.hasObserver(timer)); in testResetDetach()
44 assertFalse(subTimeBase.hasObserver(timer)); in testResetDetach()
45 assertFalse(timeBase.hasObserver(timer.getSubTimer())); in testResetDetach()
46 assertTrue(subTimeBase.hasObserver(timer.getSubTimer())); in testResetDetach()
50 timer.startRunningLocked(clocks.realtime); in testResetDetach()
51 timer.reset(true); in testResetDetach()
52 assertTrue(timeBase.hasObserver(timer)); in testResetDetach()
53 assertTrue(subTimeBase.hasObserver(timer.getSubTimer())); in testResetDetach()
57 timer.stopRunningLocked(clocks.realtime); in testResetDetach()
[all …]
DBatteryStatsBackgroundStatsTest.java255 BatteryStats.Timer timer = bi.getUidStats().get(UID).getBluetoothScanTimer(); in doTestAppBluetoothScanInternal() local
261 long time = timer.getTotalTimeLocked(curr, STATS_SINCE_CHARGED); in doTestAppBluetoothScanInternal()
262 int count = timer.getCountLocked(STATS_SINCE_CHARGED); in doTestAppBluetoothScanInternal()
264 long actualTime = timer.getTotalDurationMsLocked(clocks.realtime) * 1000; in doTestAppBluetoothScanInternal()
319 BatteryStats.Timer timer = jobs.valueAt(0); in testJob() local
320 BatteryStats.Timer bgTimer = timer.getSubTimer(); in testJob()
321 long time = timer.getTotalTimeLocked(curr, STATS_SINCE_CHARGED); in testJob()
322 int count = timer.getCountLocked(STATS_SINCE_CHARGED); in testJob()
380 BatteryStats.Timer timer = syncs.valueAt(0); in testSyncs() local
381 BatteryStats.Timer bgTimer = timer.getSubTimer(); in testSyncs()
[all …]
DBatteryStatsSensorTest.java456 BatteryStats.Timer timer = sensor.getSensorTime(); in testSensorResetTimes() local
458 assertEquals(0, timer.getTotalTimeLocked(1000*clocks.realtime, which)); in testSensorResetTimes()
459 assertEquals(0, timer.getTotalDurationMsLocked(clocks.realtime)); in testSensorResetTimes()
469 assertEquals(0, timer.getTotalTimeLocked(1000*clocks.realtime, which)); in testSensorResetTimes()
470 assertEquals(0, timer.getTotalDurationMsLocked(clocks.realtime)); in testSensorResetTimes()
479 assertEquals(0, timer.getTotalTimeLocked(1000*clocks.realtime, which)); in testSensorResetTimes()
480 assertEquals(0, timer.getTotalDurationMsLocked(clocks.realtime)); in testSensorResetTimes()
497 assertEquals(111_000, timer.getTotalTimeLocked(1000*clocks.realtime, which)); in testSensorResetTimes()
498 assertEquals(111, timer.getTotalDurationMsLocked(clocks.realtime)); in testSensorResetTimes()
508 assertEquals(0, timer.getTotalTimeLocked(1000*clocks.realtime, which)); in testSensorResetTimes()
[all …]
/frameworks/base/cmds/statsd/tests/condition/
DConditionTimer_test.cpp30 ConditionTimer timer(false, time_base); in TEST() local
31 EXPECT_EQ(false, timer.mCondition); in TEST()
32 EXPECT_EQ(0, timer.mTimerNs); in TEST()
34 EXPECT_EQ(0, timer.newBucketStart(ct_start_time)); in TEST()
35 EXPECT_EQ(0, timer.mTimerNs); in TEST()
37 timer.onConditionChanged(true, ct_start_time + 5); in TEST()
38 EXPECT_EQ(ct_start_time + 5, timer.mLastConditionTrueTimestampNs); in TEST()
39 EXPECT_EQ(true, timer.mCondition); in TEST()
41 EXPECT_EQ(95, timer.newBucketStart(ct_start_time + 100)); in TEST()
42 EXPECT_EQ(ct_start_time + 100, timer.mLastConditionTrueTimestampNs); in TEST()
[all …]
/frameworks/rs/tests/lldb/tests/
Drun_test.py181 timer = Timer(interval, on_timeout)
182 timer.start()
183 atexit.register(Timer.stop, timer)
184 return timer
187 def _quit_test(num, timer): argument
195 if timer:
196 timer.stop()
269 timer = None
310 timer = _initialise_timer(android, args.timeout)
335 timer,
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DAmbientBrightnessStatsTrackerTest.java367 AmbientBrightnessStatsTracker.Timer timer = new AmbientBrightnessStatsTracker.Timer( in testTimer() local
369 assertEquals(0, timer.totalDurationSec(), 0); in testTimer()
371 assertEquals(0, timer.totalDurationSec(), 0); in testTimer()
372 assertFalse(timer.isRunning()); in testTimer()
374 timer.start(); in testTimer()
375 assertTrue(timer.isRunning()); in testTimer()
376 assertEquals(0, timer.totalDurationSec(), 0); in testTimer()
378 assertTrue(timer.isRunning()); in testTimer()
379 assertEquals(1, timer.totalDurationSec(), 0); in testTimer()
381 timer.reset(); in testTimer()
[all …]
/frameworks/base/services/core/java/com/android/server/am/
DHealthStatsBatteryStatsWriter.java52 BatteryStats.Timer timer; in writeUid() local
91 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_FULL); in writeUid()
92 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_FULL, key, timer); in writeUid()
95 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL); in writeUid()
96 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_PARTIAL, key, timer); in writeUid()
99 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_WINDOW); in writeUid()
100 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_WINDOW, key, timer); in writeUid()
103 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_DRAW); in writeUid()
104 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_DRAW, key, timer); in writeUid()
458 private void addTimer(HealthStatsWriter writer, int key, BatteryStats.Timer timer) { in addTimer() argument
[all …]
/frameworks/base/core/java/com/android/internal/os/
DFlashlightPowerCalculator.java36 final BatteryStats.Timer timer = u.getFlashlightTurnedOnTimer(); in calculateApp() local
37 if (timer != null) { in calculateApp()
38 final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000; in calculateApp()
DCameraPowerCalculator.java38 final BatteryStats.Timer timer = u.getCameraTurnedOnTimer(); in calculateApp() local
39 if (timer != null) { in calculateApp()
40 final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000; in calculateApp()
DWakelockPowerCalculator.java44 BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL); in calculateApp() local
45 if (timer != null) { in calculateApp()
46 wakeLockTimeUs += timer.getTotalTimeLocked(rawRealtimeUs, statsType); in calculateApp()
DSensorPowerCalculator.java46 final BatteryStats.Timer timer = sensor.getSensorTime(); in calculateApp() local
47 final long sensorTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000; in calculateApp()
/frameworks/rs/script_api/
Drs_time.spec65 arg: const rs_time_t* timer, "Input time as a number of seconds since January 1, 1970."
68 Converts the time specified by timer into a @rs_tm structure that provides year, month,
78 arg: rs_time_t* timer, "Location to also store the returned calendar time."
83 If timer is non-NULL, the result is also stored in the memory pointed to by
/frameworks/rs/script_api/include/
Drs_time.rsh73 * Converts the time specified by timer into a rs_tm structure that provides year, month,
81 * timer: Input time as a number of seconds since January 1, 1970.
86 rsLocaltime(rs_tm* local, const rs_time_t* timer);
93 * If timer is non-NULL, the result is also stored in the memory pointed to by
97 * timer: Location to also store the returned calendar time.
102 rsTime(rs_time_t* timer);
/frameworks/base/media/mca/filterfw/java/android/filterfw/core/
DGLFrame.java141 StopWatchMap timer = GLFrameTimer.get(); in flushGPU() local
142 if (timer.LOG_MFF_RUNNING_TIMES) { in flushGPU()
143 timer.start("glFinish " + message); in flushGPU()
145 timer.stop("glFinish " + message); in flushGPU()
/frameworks/base/core/java/android/os/
DBatteryStats.java3183 private static long computeWakeLock(Timer timer, long elapsedRealtimeUs, int which) { in computeWakeLock() argument
3184 if (timer != null) { in computeWakeLock()
3186 long totalTimeMicros = timer.getTotalTimeLocked(elapsedRealtimeUs, which); in computeWakeLock()
3203 private static final String printWakeLock(StringBuilder sb, Timer timer, in printWakeLock() argument
3206 if (timer != null) { in printWakeLock()
3207 long totalTimeMillis = computeWakeLock(timer, elapsedRealtimeUs, which); in printWakeLock()
3209 int count = timer.getCountLocked(which); in printWakeLock()
3220 final long maxDurationMs = timer.getMaxDurationMsLocked(elapsedRealtimeUs/1000); in printWakeLock()
3226 final long totalDurMs = timer.getTotalDurationMsLocked(elapsedRealtimeUs/1000); in printWakeLock()
3231 if (timer.isRunningLocked()) { in printWakeLock()
[all …]
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/controllers/
DQuotaController.java554 Timer timer = mPkgTimers.get(userId, packageName); in prepareForExecutionLocked() local
555 if (timer == null) { in prepareForExecutionLocked()
556 timer = new Timer(uid, userId, packageName); in prepareForExecutionLocked()
557 mPkgTimers.add(userId, packageName, timer); in prepareForExecutionLocked()
559 timer.startTrackingJobLocked(jobStatus); in prepareForExecutionLocked()
566 Timer timer = mPkgTimers.get(jobStatus.getSourceUserId(), in maybeStopTrackingJobLocked() local
568 if (timer != null) { in maybeStopTrackingJobLocked()
569 timer.stopTrackingJob(jobStatus); in maybeStopTrackingJobLocked()
604 Timer timer = mPkgTimers.get(userId, packageName); in clearAppStats() local
605 if (timer != null) { in clearAppStats()
[all …]
/frameworks/rs/tests/lldb/tests/harness/
Dtest_base_remote.py32 def __init__(self, device_port, device, timer, *args, **kwargs): argument
33 super(TestBaseRemote, self).__init__(device_port, device, timer, *args, **kwargs)
Dtest_base.py44 def __init__(self, device_port, device, timer, app_type, wimpy=False, **kwargs): argument
50 self._timer = timer # timer instance, to check whether the test froze
/frameworks/rs/
DrsScriptC_Lib.cpp78 time_t rsrTime(Context *rsc, time_t *timer) { in rsrTime() argument
79 return time(timer); in rsrTime()
82 tm* rsrLocalTime(Context *rsc, tm *local, time_t *timer) { in rsrLocalTime() argument
90 tm *tmp = localtime(timer); in rsrLocalTime()
/frameworks/base/tools/orientationplot/
Dorientationplot.py182 self.timer = self.fig.canvas.new_timer(interval=100)
183 self.timer.add_callback(lambda: self.update())
184 self.timer.start()
193 self.timer.stop()
196 self.timer.start()
/frameworks/base/tools/velocityplot/
Dvelocityplot.py117 self.timer = self.fig.canvas.new_timer(interval=100)
118 self.timer.add_callback(lambda: self.update())
119 self.timer.start()

12