Edit

kc3-lang/angle/util/Timer.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2019-12-16 16:03:57
    Hash : 9190f49c
    Message : GN: Make new angle_test_utils target. This source set target lets other targets import the test utils without needing to export them. They get built into angle_util. They also get compiled into the various tests and samples. The change also fixes export issues. Moves some of the GN logic into the util/ subfolder. Bug: angleproject:3162 Bug: chromium:1030192 Change-Id: If99d201092ad8541c0de60b3bd893ac9b5875270 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1968259 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>

  • util/Timer.h
  • //
    // Copyright 2019 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.
    //
    
    #ifndef SAMPLE_UTIL_TIMER_H
    #define SAMPLE_UTIL_TIMER_H
    
    class Timer final
    {
      public:
        Timer();
        ~Timer() {}
    
        // Use start() and stop() to record the duration and use getElapsedTime() to query that
        // duration.  If getElapsedTime() is called in between, it will report the elapsed time since
        // start().
        void start();
        void stop();
        double getElapsedTime() const;
    
      private:
        bool mRunning;
        double mStartTime;
        double mStopTime;
    };
    
    #endif  // SAMPLE_UTIL_TIMER_H