Created
September 23, 2018 06:21
-
-
Save ilyachenko/82be7d08c31f7968e220e1f0c7c7fa55 to your computer and use it in GitHub Desktop.
RxJs vs native timeout
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
const timer$ = timer(1000); | |
timer$.subscribe(t => console.time('RxJs')) | |
timer$.subscribe(t => console.timeEnd('RxJs')); | |
setTimeout(() => console.time('setTimeout'), 1000); | |
setTimeout(() => console.timeEnd('setTimeout'), 1000); | |
// RxJs: 1.580078125ms | |
// setTimeout: 0.57373046875ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment