Skip to content

Instantly share code, notes, and snippets.

View badrinathvm's full-sized avatar

Badarinath Venkatnarayansetty badrinathvm

View GitHub Profile
import Foundation
import Combine
var subscriptions = Set<AnyCancellable>()
let start = Date()
Timer.publish(every: 1.0, on: .main, in: .common)
.autoconnect()
.map({ (output) in
return output.timeIntervalSince(start)