Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fire 2 time in each repeat #34

Open
Hajitsu opened this issue Nov 30, 2018 · 0 comments
Open

Fire 2 time in each repeat #34

Hajitsu opened this issue Nov 30, 2018 · 0 comments

Comments

@Hajitsu
Copy link

Hajitsu commented Nov 30, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant