GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
cycle_timer.h
Go to the documentation of this file.
1// Copyright 2016 The Draco Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15#ifndef DRACO_CORE_CYCLE_TIMER_H_
16#define DRACO_CORE_CYCLE_TIMER_H_
17
18#ifdef _WIN32
19#ifndef WIN32_LEAN_AND_MEAN
20#define WIN32_LEAN_AND_MEAN
21#endif
22#include <windows.h>
23typedef LARGE_INTEGER DracoTimeVal;
24#else
25#include <sys/time.h>
26typedef timeval DracoTimeVal;
27#endif
28
29#include <cinttypes>
30#include <cstddef>
31
32namespace draco {
33
35 public:
38 void Start();
39 void Stop();
40 int64_t GetInMs();
41
42 private:
43 DracoTimeVal tv_start_;
44 DracoTimeVal tv_end_;
45};
46
48
49} // namespace draco
50
51#endif // DRACO_CORE_CYCLE_TIMER_H_
Definition cycle_timer.h:34
void Start()
Definition cycle_timer.cc:18
~DracoTimer()
Definition cycle_timer.h:37
void Stop()
Definition cycle_timer.cc:26
DracoTimer()
Definition cycle_timer.h:36
int64_t GetInMs()
Definition cycle_timer.cc:34
timeval DracoTimeVal
Definition cycle_timer.h:26
Definition attribute_octahedron_transform.cc:21
DracoTimer CycleTimer
Definition cycle_timer.h:47