MBAclock.h

00001 //===========================================================================
00002 // SINTEF LSMG library - version 1.1
00003 //
00004 // Copyright (C) 2000-2005 SINTEF ICT, Applied Mathematics, Norway.
00005 //
00006 // This program is free software; you can redistribute it and/or          
00007 // modify it under the terms of the GNU General Public License            
00008 // as published by the Free Software Foundation version 2 of the License. 
00009 //
00010 // This program is distributed in the hope that it will be useful,        
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of         
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          
00013 // GNU General Public License for more details.                           
00014 //
00015 // You should have received a copy of the GNU General Public License      
00016 // along with this program; if not, write to the Free Software            
00017 // Foundation, Inc.,                                                      
00018 // 59 Temple Place - Suite 330,                                           
00019 // Boston, MA  02111-1307, USA.                                           
00020 //
00021 // Contact information: e-mail: tor.dokken@sintef.no                      
00022 // SINTEF ICT, Department of Applied Mathematics,                         
00023 // P.O. Box 124 Blindern,                                                 
00024 // 0314 Oslo, Norway.                                                     
00025 //
00026 // Other licenses are also available for this software, notably licenses
00027 // for:
00028 // - Building commercial software.                                        
00029 // - Building software whose source code you wish to keep private.        
00030 //===========================================================================
00031 #ifndef _MBACLOCK_H_
00032 #define _MBACLOCK_H_
00033 
00034 #include <time.h>
00035 class MBAclock {
00036   //long    i = 600000L;
00037   clock_t start, finish;
00038   double  duration;
00039   
00040 public:
00041   MBAclock(){start = clock();}
00042   ~MBAclock(){};
00043   double getInterval() {
00044     finish = clock(); 
00045     duration = (double)(finish - start) / CLOCKS_PER_SEC;
00046     start = finish;
00047     return duration;
00048   }
00049 };
00050 
00051 #endif

Generated on Wed Nov 28 12:27:29 2007 for LSMG by  doxygen 1.5.1