Open tkellehe opened 7 years ago
11 bytes
With the new get the time since execution start can save two bytes. Should have added this when I added the get current time...
QjȥḶGQɱ⁻Ñ€Ƭ
# Program execution start time is implicitly recorded.
Qjȥ # Creates the value 2001.
Qj # Pushes the string literal "Qj" onto the stack.
ȥ # Treats the string as a base 98 number corresponding to the Noodel code page.
ḶGQɱ⁻Ñ€ # Prints -1000 ... 1000.
Ḷ # Consumes the 2001 and loops the following code that many times.
GQ # Pushes the string literal "GQ" onto the stack.
ɱ # Pushes on the loop counter (zero based).
⁻ # Attempts to subtract (ɱ - "GQ") and since ɱ is a number the string will be converted into a number (which will fail therein default to base 98 conversion).
Ñ # Consumes the difference and prints it to the screen followed by a new line.
€ # End of the loop.
Ƭ # Pushes on the amount of time passed since the start in milliseconds.
An update to the looping function now numerical eval strings.
10 bytes
QjḶGQɱ⁻Ñ€Ƭ
# Program execution start time is implicitly recorded.
Qj # Pushes the string literal "Qj" onto the stack.
ḶGQɱ⁻Ñ€ # Prints -1000 ... 1000.
Ḷ # Consumes the "Qj" and evaluates as base 98 to get 2001 and loops the following code that many times.
GQ # Pushes the string literal "GQ" onto the stack.
ɱ # Pushes on the loop counter (zero based).
⁻ # Attempts to subtract (ɱ - "GQ") and since ɱ is a number the string will be converted into a number (which will fail therein default to base 98 conversion).
Ñ # Consumes the difference and prints it to the screen followed by a new line.
€ # End of the loop.
Ƭ # Pushes on the amount of time passed since the start in milliseconds.
http://codegolf.stackexchange.com/questions/106856/time-taken-to-print-numbers
17 bytes
My answer
Try it:)