updated licenses info
[platform/core/uifw/lottie-player.git] / src / vector / velapsedtimer.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the LGPL License, Version 2.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.gnu.org/licenses/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef VELAPSEDTIMER_H
18 #define VELAPSEDTIMER_H
19
20 #include <chrono>
21 #include "vglobal.h"
22
23 class VElapsedTimer {
24 public:
25     double      elapsed() const;
26     bool        hasExpired(double millsec);
27     void        start();
28     double      restart();
29     inline bool isValid() const { return m_valid; }
30
31 private:
32     std::chrono::high_resolution_clock::time_point clock;
33     bool                                           m_valid{false};
34 };
35 #endif  // VELAPSEDTIMER_H