Time taken to print numbers
Octave, 46 43 36 30 23 bytes
tic;(-1e3:1e3)',toc*1e3
This will print:
ans =
-1000
-999
-998
-997
-996
-995
If you don't like the ans =
, then we have to add an additional 6 bytes for disp
:
tic;disp((-1e3:1e3)'),toc*1e3
Saved a lot of bytes thanks to a few reminders from rahnema1.
Explanation:
tic; % Starts timer
(-1e3:1e3)' % A vertical vector -1000 ... 1000
disp((-1e3:1e3)'), % Display this vector
toc*1e3 % Stop the timer and output the time in milliseconds
MATL, 13 bytes
1e3t_y&:!DZ`*
Try it online!
% Implicitly start timer
1e3 % Push 1000
% STACK: 1000
t_ % Duplicate, negate
% STACK: 1000, -1000
y % Duplicate second-top number
% STACK: 1000, -1000, 1000
&: % Two-input range
% STACK: 1000, [-1000, 999, ..., 1000]
! % Transpose into column vector
% STACK: 1000, [-1000; 999; ...; 1000]
D % Display
% STACK: 1000
Z` % Push timer value, say t
% STACK: 1000, t
* % Multiply
% STACK: 1000*t
% Implicitly display
JavaScript, 60 bytes
(c=console).time();for(i=~1e3;i++<1e3;c.log(i));c.timeEnd();
In order to get all the events logged, you should use the script from the developer console (otherwise the logs are erased after the certain amount of them).