X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmisc%2Fstopwatch.hxx;h=bb8ebc4fb1c4ca5f9b6c7e686b48484e7c241882;hb=3b3baa996b2485855534f08b68c52f3a40149598;hp=4431d92e5d1036202e8b08ac8861157c012b2c23;hpb=82459a2802a939434f9fc5b88d2b2aea58f0043d;p=simgear.git diff --git a/simgear/misc/stopwatch.hxx b/simgear/misc/stopwatch.hxx index 4431d92e..bb8ebc4f 100644 --- a/simgear/misc/stopwatch.hxx +++ b/simgear/misc/stopwatch.hxx @@ -1,12 +1,20 @@ -/*************************************************************************** - * stopwatch.hxx Timer class, for use in benchmarking - * +/** + * \file stopwatch.hxx + * Timer class, for use in benchmarking * Based on blitz/Timer.h * - * $Id$ - * * Copyright (C) 1997,1998 Todd Veldhuizen * + * Suggestions: blitz-suggest@cybervision.com + * Bugs: blitz-bugs@cybervision.com + * + * For more information, please see the Blitz++ Home Page: + * http://seurat.uwaterloo.ca/blitz/ + */ + +/* + * $Id$ + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either @@ -22,12 +30,6 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * - * Suggestions: blitz-suggest@cybervision.com - * Bugs: blitz-bugs@cybervision.com - * - * For more information, please see the Blitz++ Home Page: - * http://seurat.uwaterloo.ca/blitz/ - * */ // This class is not portable to non System V platforms. @@ -66,30 +68,34 @@ # include #endif +/** + * A high resolutions timing class + */ class StopWatch { public: - StopWatch() - { -// state_ = uninitialized; + /** Constructor */ + StopWatch() { + // state_ = uninitialized; } - void start() - { -// state_ = running; + /** Start counting time */ + void start() { + // state_ = running; t1_ = systemTime(); } - void stop() - { + /** Stop counting time */ + void stop() { t2_ = systemTime(); -// BZPRECONDITION(state_ == running); -// state_ = stopped; + // BZPRECONDITION(state_ == running); + // state_ = stopped; } + /** @return the elapsed time between start and stop */ double elapsedSeconds() { -// BZPRECONDITION(state_ == stopped); + // BZPRECONDITION(state_ == stopped); return t2_ - t1_; }