Created
June 10, 2016 02:52
-
-
Save bricklife/6cd7b844a278ada0cf1a49279d8bdbe4 to your computer and use it in GitHub Desktop.
同じものをRxSwiftで組んでみた。こちらは期待通りの動き。RACのほうはスケジューラ内の仮想時間がadvanceした時刻に即進んじゃうのね #CodePiece
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
import RxTests | |
let scheduler = TestScheduler(initialClock: 0) | |
Observable<Int>.interval(10, scheduler: scheduler) | |
.subscribe { _ in print(scheduler.now) } | |
scheduler.advanceTo(60) | |
/* | |
1970-01-01 00:00:10 +0000 | |
1970-01-01 00:00:20 +0000 | |
1970-01-01 00:00:30 +0000 | |
1970-01-01 00:00:40 +0000 | |
1970-01-01 00:00:50 +0000 | |
1970-01-01 00:01:00 +0000 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment