-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
I use the below code for print date and time every 2 second. but Repeat run inside code 2 time in each fire.
private var timer: Repeater?
self.timer = Repeater.every(.seconds(2)) { _ in
print("App from \(from) => \(String(self.gf.getCurrentDateTime()))")
}
Result in console is here:
App from vcChatMain => 20181130135222
App from vcChatMain => 20181130135222
App from vcChatMain => 20181130135224
App from vcChatMain => 20181130135224
App from vcChatMain => 20181130135226
App from vcChatMain => 20181130135226
App from vcChatMain => 20181130135228
App from vcChatMain => 20181130135228
As you see, every 2 second, print method fire 2 time. Why this problem occurred?
elliotekj
Metadata
Metadata
Assignees
Labels
No labels