Main Page Namespace List Class Hierarchy Alphabetical List Data Structures File List Namespace Members Data Fields Globals

# ExCTime.h

Go to the documentation of this file.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  * $Id: ExCTime.h,v 1.4 2002/07/05 12:50:38 binny Exp $
    00021  *
    00022  */
    00023
    00024 #ifndef __EXCTIME_H
    00025 #define __EXCTIME_H
    00026
    00027 #include <iostream>
    00028 #ifdef UNIX_SRC
    00029 #include <unistd.h>
    00030 #endif
    00031 #include <ctime>
    00032
    00033 class ExCTime {
    00034         private:
    00035 #ifdef UNIX_SRC
    00036                 clock_t _start, _finish;
    00037 #endif
    00038                 time_t _real_t0, _real_t1;
    00039                 float _long_t;
    00040         public:
    00041                 ExCTime ();
    00042                 bool start (float);
    00043                 bool stop (void);
    00044
    00045                 // using this method force the software
    00046                 // to wait for time is finished
    00047                 bool startBlock (float);
    00048
    00049                 // this use the real time
    00050                 bool isTimePassed (float);
    00051                 bool isFinished (void);
    00052 #ifdef UNIX_SRC
    00053                 // this use clock time, not real time
    00054                 bool isClockTimePassed (float);
    00055                 bool isClockFinished (void);
    00056 #endif
    00057 };
    00058
    00059 #endif // __EXCTIME_H