ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
clock.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) by Fred Klaus *
3  * development@fkweb.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef ROLAND_CLOCK_H
21 #define ROLAND_CLOCK_H
22 
23 #include "SDL.h"
24 
25 namespace sdltk
26 {
27 
29 class Clock final
30 {
31 
32 public:
34  Clock() : mLast(SDL_GetTicks()) {};
37 
39  void init() {mLast = SDL_GetTicks();}
41  uint elapsed() const {return SDL_GetTicks() - mLast;}
42 
43 private:
45 
46 };
47 
48 } // sdltk
49 
50 #endif // ROLAND_CLOCK_H
void init()
Definition: roland.cpp:97
uint mLast
Definition: clock.h:44
Clock()
Standardconstructor.
Definition: clock.h:34
~Clock() ROLAND_DEFAULT void init()
Standarddestructor.
Definition: clock.h:36
Time measurement in ms.
Definition: clock.h:29
uint elapsed() const
Returns the time ellapsed sinze init() in ms.
Definition: clock.h:41
#define ROLAND_DEFAULT
Definition: compspec.h:46
unsigned int uint
Definition: types.h:121
the SDL based Stuff
Definition: audio.cpp:22