snapshot current state before gitea sync
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import Foundation
|
||||
|
||||
enum SyncClock {
|
||||
private static var hostOffset: TimeInterval = 0
|
||||
|
||||
static func uptime() -> TimeInterval {
|
||||
ProcessInfo.processInfo.systemUptime
|
||||
}
|
||||
|
||||
static func setHostOffset(hostUptime: TimeInterval, peerUptime: TimeInterval) {
|
||||
hostOffset = hostUptime - peerUptime
|
||||
}
|
||||
|
||||
static func convert(hostUptime: TimeInterval) -> TimeInterval {
|
||||
hostUptime - hostOffset
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user