mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 14:02:25 -05:00 
			
		
		
		
	
		
			
	
	
		
			22 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
	
		
			310 B
		
	
	
	
		
			Go
		
	
	
	
	
	
|  | package logger | ||
|  | 
 | ||
|  | import ( | ||
|  | 	"sync" | ||
|  | 	"time" | ||
|  | 
 | ||
|  | 	"codeberg.org/gruf/go-nowish" | ||
|  | ) | ||
|  | 
 | ||
|  | var ( | ||
|  | 	clock     = nowish.Clock{} | ||
|  | 	clockOnce = sync.Once{} | ||
|  | ) | ||
|  | 
 | ||
|  | // startClock starts the global nowish clock | ||
|  | func startClock() { | ||
|  | 	clockOnce.Do(func() { | ||
|  | 		clock.Start(time.Millisecond * 10) | ||
|  | 		clock.SetFormat("2006-01-02 15:04:05") | ||
|  | 	}) | ||
|  | } |