2 #ifndef _GLIBMM_TIMER_H
3 #define _GLIBMM_TIMER_H
5 /* $Id: timer.h 2 2003-01-07 16:59:16Z murrayc $ */
9 * Copyright (C) 2002 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 extern "C" { typedef struct _GTimer GTimer; }
32 /** Portable stop watch interface.
33 * This resembles a convient and portable timer with microseconds resolution.
38 /** Create a new timer.
39 * Also starts timing by calling start() implicitly.
48 /** Get the elapsed time.
49 * @return The value in seconds.
51 double elapsed() const;
53 /** Get the elapsed time.
54 * @return The value in seconds. Also fills @p microseconds
55 * with the corresponding @htmlonlyµs@endhtmlonly value.
57 double elapsed(unsigned long& microseconds) const;
59 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 GTimer* gobj() { return gobject_; }
61 const GTimer* gobj() const { return gobject_; }
69 Timer& operator=(const Timer&);
73 void usleep(unsigned long microseconds);
78 #endif /* _GLIBMM_TIMER_H */