summaryrefslogtreecommitdiff
path: root/Source/ThirdParty/ANGLE/util/linux/LinuxTimer.h
blob: 8e68dd84297907276a55c66cf466dddb95aa7dea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//
// Copyright (c) 2015 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

// LinuxTimer.h: Definition of a high precision timer class on Linux

#ifndef UTIL_LINUX_TIMER_H
#define UTIL_LINUX_TIMER_H

#include <time.h>

#include "Timer.h"

class LinuxTimer : public Timer
{
  public:
    LinuxTimer();

    void start() override;
    void stop() override;
    double getElapsedTime() const override;

  private:
    bool mRunning;
    struct timespec mStartTime;
    struct timespec mStopTime;
};

#endif // UTIL_LINUX_TIMER_H