Skip to content

Instantly share code, notes, and snippets.

@bricklife
Created April 20, 2016 06:46
Show Gist options
  • Save bricklife/a8e963444dc7aa338d10018cde41aa71 to your computer and use it in GitHub Desktop.
Save bricklife/a8e963444dc7aa338d10018cde41aa71 to your computer and use it in GitHub Desktop.
うおー、HistoricalScheduler便利だ! #CodePiece #rxswift
import Foundation
import RxSwift
let now = NSDate()
let scheduler = HistoricalScheduler(initialClock: now)
_ = Observable<Int>.interval(0.5, scheduler: scheduler)
.subscribe { print($0) }
scheduler.advanceTo(now.dateByAddingTimeInterval(1))
// Next(0)
// Next(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment