Check out example codes for "timer in swift stack overflow". It will help you in understanding the concepts better.

Code Example 1

var timer = NSTimer()
timer(timeInterval: 0.01, target: self, selector: update, userInfo: nil, repeats: false)

Learn ReactJs, React Native from akashmittal.com