| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/time/time.h" |
| 12 |
| 13 namespace vr_shell { |
| 14 |
| 15 // Computes fps based on submitted frame times. |
| 16 class FPSMeter { |
| 17 public: |
| 18 FPSMeter(); |
| 19 ~FPSMeter(); |
| 20 |
| 21 void AddFrame(const base::TimeTicks& time_stamp); |
| 22 |
| 23 bool CanComputeFPS() const; |
| 24 |
| 25 double GetFPS() const; |
| 26 |
| 27 private: |
| 28 size_t current_index_; |
| 29 base::TimeTicks last_time_stamp_; |
| 30 std::vector<base::TimeDelta> frame_times_; |
| 31 DISALLOW_COPY_AND_ASSIGN(FPSMeter); |
| 32 }; |
| 33 |
| 34 } // namespace vr_shell |
| 35 |
| 36 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_ |
| OLD | NEW |