Kerne: SystemTimer can now output the current real time
This commit is contained in:
		
							parent
							
								
									bc0e1fa898
								
							
						
					
					
						commit
						d8a9d4a24e
					
				| 
						 | 
				
			
			@ -28,6 +28,7 @@ namespace Kernel
 | 
			
		|||
		void sleep(uint64_t) const;
 | 
			
		||||
 | 
			
		||||
		uint64_t get_unix_timestamp() const;
 | 
			
		||||
		timespec get_real_time() const;
 | 
			
		||||
 | 
			
		||||
	private:
 | 
			
		||||
		SystemTimer() = default;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,4 +79,11 @@ namespace Kernel
 | 
			
		|||
		return m_boot_time + ms_since_boot() / 1000;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	timespec SystemTimer::get_real_time() const
 | 
			
		||||
	{
 | 
			
		||||
		auto result = time_since_boot();
 | 
			
		||||
		result.tv_sec += m_boot_time;
 | 
			
		||||
		return result;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue