Created
August 15, 2020 02:20
-
-
Save Elvis10ten/2fd9bcbd04b05799305e925ffc5e805b to your computer and use it in GitHub Desktop.
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
// Example 1: Prints falsehoods at roughly 10 Hz | |
while(true) { | |
Thread.sleep(100) | |
println("Ronaldo is better than Messi") | |
} | |
// Example 2: Prints truism at roughly 1 KHz | |
while(true) { | |
Thread.sleep(1) | |
println("Human beings are great") | |
} | |
// Aside: Thread.sleep is subject to the precision and accuracy of system timers and schedulers. | |
// It is affected by system load and non-realtime OSes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment