Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple GCD-based timer based on NSTimer
branch: master
Failed to load latest commit information.
.idea Add -fire method.
RNTimer.xcodeproj Cleanup code slightly.
RNTimer Cleanup code slightly.
RNTimerTests Add test case for scaling.
.gitignore Update doc settings
AppledocSettings.plist Update doc settings Update README


Simple GCD-based timer based on NSTimer. It starts immediately and stops when released. This avoids many of the typical problems with NSTimer:

  • RNTimer runs in all modes (unlike NSTimer)
  • RNTimer runs when there is no runloop (unlike NSTimer)
  • Repeating RNTimers can easily avoid retain loops (unlike NSTimer)

Currently there is only a simple repeating timer (since this is the most common use that's hard to do correctly with NSTimer). It always runs on the main queue.


__weak id weakSelf = self;
self.timer =
    [RNTimer repeatingTimerWithTimeInterval:1
                                        [weakSelf doSomething];


Something went wrong with that request. Please try again.