include/TimeStatisticMaker.hpp

Go to the documentation of this file.
00001 // TimeStatisticMaker.hpp: this file is part of the REGAL project.
00002 //
00003 // REGAL : Random and Exhaustive Generators for Automata - Library
00004 //
00005 // Copyright (C) 2007 Julien DAVID.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 //
00016 #ifndef TIMESTATISTICMAKER
00017 #define TIMESTATISTICMAKER
00018 
00019 #include "StatisticMaker.hpp"
00020 #include <sys/timeb.h>
00021 #include <ctime>
00022 
00023 namespace regal{
00024   
00025   class TimeStatisticMaker:public StatisticMaker{
00026   private:
00027     struct timeb before,after;
00028     double duration; 
00029   public:
00030     
00034     void startingTime(){
00035       ftime(&before);
00036     }
00037     
00041     void endingTime(){
00042       ftime(&after);
00043       duration=(after.time-before.time)+(after.millitm-before.millitm)/1000.;
00044     }
00045     
00050     double getDuration(){
00051       return duration;
00052     }
00053     
00057     void addValue(){
00058       fprintf(output,"%f\n",duration);
00059     }
00060     
00066     TimeStatisticMaker(char * path,char * option):StatisticMaker::StatisticMaker(path,option){
00067     }
00068     
00072     TimeStatisticMaker(){}
00073     
00077     ~TimeStatisticMaker(){}
00078   
00079     
00080   };
00081 
00082 
00083 }
00084 
00085 #endif 

Generated on Mon Sep 29 16:33:58 2008 for REGAL by  doxygen 1.5.1