mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-10-28 05:40:11 -04:00 
			
		
		
		
	util/time: Move NSEC_PER_SEC to header
This constant can be useful whenever one has to deal with timespecs, so let's move it to the header.
This commit is contained in:
		
							parent
							
								
									d6b47c3ab0
								
							
						
					
					
						commit
						0d728f96b7
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		|  | @ -4,6 +4,8 @@ | |||
| #include <stdint.h> | ||||
| #include <time.h> | ||||
| 
 | ||||
| static const long NSEC_PER_SEC = 1000000000; | ||||
| 
 | ||||
| /**
 | ||||
|  * Get the current time, in milliseconds. | ||||
|  */ | ||||
|  |  | |||
|  | @ -3,8 +3,6 @@ | |||
| 
 | ||||
| #include "util/time.h" | ||||
| 
 | ||||
| static const long NSEC_PER_SEC = 1000000000; | ||||
| 
 | ||||
| int64_t timespec_to_msec(const struct timespec *a) { | ||||
| 	return (int64_t)a->tv_sec * 1000 + a->tv_nsec / 1000000; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Kenny Levinsen
						Kenny Levinsen