// Sleepings.kt (c) Kari Laitinen // http://www.naturalprogramming.com // 2023-01-12 File created. // Testing the Thread.sleep() method. fun main() { print( "\n Let's first wait 5 seconds ... \n" ) try { Thread.sleep( 5000 ) // 5 s = 5000 milliseconds } catch ( caught_exception : InterruptedException ) { } print( "\n Counting down ... \n\n" ) var shrinking_number = 10 while ( shrinking_number > 0 ) { try { Thread.sleep( 1000 ) ; // 1 second pause. } catch ( caught_exception : InterruptedException ) { } print( " " + shrinking_number + "\u0007" ) shrinking_number -- } print( "\n\n" ) }