Create Clock.cpp
This commit is contained in:
		
							
								
								
									
										20
									
								
								internal/Clock.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								internal/Clock.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
			
		||||
#include "Clock.hpp"
 | 
			
		||||
 | 
			
		||||
namespace rnd7 {
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////
 | 
			
		||||
    Time Clock::getElapsedTime() const {
 | 
			
		||||
        return getCurrentTime() - m_startTime;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
////////////////////////////////////////////////////////////
 | 
			
		||||
    Time Clock::restart() {
 | 
			
		||||
        Time now = getCurrentTime();
 | 
			
		||||
        Time elapsed = now - m_startTime;
 | 
			
		||||
        m_startTime = now;
 | 
			
		||||
 | 
			
		||||
        return elapsed;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user