Skip to content
Snippets Groups Projects
CPUTime.cpp 557 B
Newer Older
  • Learn to ignore specific revisions
  • Lars Bilke's avatar
    Lars Bilke committed
    /**
    
    Lars Bilke's avatar
    Lars Bilke committed
     * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
    
    Lars Bilke's avatar
    Lars Bilke committed
     *            Distributed under a Modified BSD License.
     *              See accompanying file LICENSE.txt or
    
     *              http://www.opengeosys.com/LICENSE.txt
    
    Lars Bilke's avatar
    Lars Bilke committed
     *
     *
    
    Lars Bilke's avatar
    Lars Bilke committed
     * \file CPUTime.cpp
    
    Lars Bilke's avatar
    Lars Bilke committed
     * Created on 2012-05-10 by Thomas Fischer
    
     */
    
    #include "CPUTime.h"
    
    namespace BaseLib {
    
    void CPUTime::start()
    {
    	_start = clock();
    }
    
    void CPUTime::stop()
    {
    	_stop = clock();
    }
    
    double CPUTime::elapsed()
    {
    	return (_stop-_start)/(double)(CLOCKS_PER_SEC);
    }
    
    } // end namespace BaseLib