[Question]
  [
# Summary
Write a program or function, which doesn't take any input, and outputs all the integer numbers, between -1000 and 1000 in ascending order, to the stdout, one per line, like this:
```
-1000
-999
-998
-997
...
```
And after that you need to print the time taken to print these numbers, or the time from the start of the program's execution in milliseconds (if necessary, it can also contain some other things, for example: time taken:xxxms is ok). It can be a float, or an integer (if you print an integer, you need to round down to the nearest).
# Example code
```
using System;
using System.Diagnostics;
class P
{
    static void Main(string[] args)
    {
        Stopwatch st = Stopwatch.StartNew();
        for (int i = -1000; i <= 1000; i++)
        {
            Console.WriteLine(i);
        }
        Console.WriteLine(st.ElapsedMilliseconds);      
    }
}
```
# Restrictions
Standard loopholes are not allowed
# Other infos
It's code golf, so the shortest submission wins.
  
[Answer]
# [MATL](https://github.com/lmendo/MATL), 13 bytes
```
1e3t_y&:!DZ`*
```
[Try it online!](https://tio.run/nexus/matl#@2@YalwSX6lmpegSlaD1/z8A "MATL – TIO Nexus")
```
       % 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
```
[Answer]
# 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
```
[Answer]
# 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).
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 18 bytes
```
es2001{1e3-n}/es\-
```
[Try it online!](https://tio.run/nexus/cjam#@59abGRgYFhtmGqsm1ern1oco/v/PwA "CJam – TIO Nexus")
### How it works
```
es                  Push the current time (milliseconds since epoch) on the stack.
  2001{     }/      For each integer X from 0 to 2000:
       1e3-           Subtract 1000 from X.
           n          Print with a newline.
              es    Push the current time on the stack.
                \-  Swap and subtract.
```
[Answer]
# Python 3.5, ~~80~~ ~~77~~ 73 bytes
```
import time
*map(print,range(-1000,1001)),
print(time.process_time()*1e3)
```
Previous solutions involved using `timeit` and `time.time()`, they were larger.
Sadly, [`time.process_time()`](https://docs.python.org/3/library/time.html#time.process_time) was introduced in python 3.3.
Thanks to [Dennis](https://codegolf.stackexchange.com/users/12012/dennis) for saving 4 bytes!
[Answer]
# Bash (+coreutils), ~~41~~, ~~49~~, ~~46~~, ~~44~~, 42 bytes
EDITS:
* Refactored to use Bash-builtin (time), to address @Dennis precision concerns;
* Reduced by 3 bytes, by utilizing Bash 4+ `|&` for stderr redirection;
* Saved 2 more bytes by replacing `seq -1000 1000` with `seq -1e3 1e3` (Thanks @Dennis !);
* -2 bytes by removing unnecessary backslash, and using default precision (Thx @Dennis !).
**Golfed**
```
TIMEFORMAT=%R*1000;(time seq -1e3 1e3)|&bc
```
[Try It Online !](https://tio.run/nexus/bash#@x/i6evq5h/k6xhiqxqkZWhgYGCtUZKZm6pQnFqooGuYaqwAxJo1aknJ//8DAA)
**Sidenote**
Using a coreutils "time" utility, instead of the Bash-builtin, results in a ~~41~~, 35 byte solution:
```
\time -f "%e*1000" seq -1e3 1e3|&bc
```
***"\"*** is here to make *bash* invoke the real command, instead of the builtin.
Unfortunately coreutils *time* precision is only 1/100s, which have raised concerns on if it is a valid solution.
[Answer]
## R, 42 bytes
```
system.time(cat(-1e3:1e3,sep="\n"))[3]*1e3
```
This will print
```
.
.
.
998
999
1000
elapsed 
     60 
```
To remove `elapsed`, two additional bytes are necessary:
```
system.time(cat(-1e3:1e3,sep="\n"))[[3]]*1e3
```
[Answer]
# Bash + GNU utils, 43
* Saved 2 bytes thanks to @Dennis
* Saved 5 bytes thanks to @zeppelin
```
c=date\ +%s%3N
s=`$c`
seq -1e3 1e3
$c-$s|bc
```
The `date` command gives the number of seconds since the epoch concatenated with current nanoseconds. This command is run before and after. `bc` takes the difference and prints.
[Try it online](https://tio.run/nexus/bash#@59sm5JYkhqjoK1arGrsx1Vsm6CSnMBVnFqooGuYaqwAxFwqyboqxTVJyf//AwA).
---
I was hoping to do this for 17:
```
time seq -1e3 1e3
```
But the output of time gives more than we need:
```
real    0m0.004s
user    0m0.000s
sys 0m0.004s
```
[Answer]
# JavaScript (ES6), ~~63~~ 59 bytes
```
for(c=console.log,i=~1e3;i<1e3;c(++i));c(performance.now())
```
[Answer]
## R, 66 bytes
```
x=proc.time();for(i in -1e3:1e3)cat(i,"\n");(proc.time()-x)[3]*1e3
```
Probably not the shortest but it works. 
[Answer]
# Mathematica, 51 bytes
```
p[1*^3#]&@@AbsoluteTiming@Array[p=Print,2001,-1*^3]
```
**Explanation**
```
Array[p=Print,2001,-1*^3]
```
Store the `Print` function in `p`. Print 2001 numbers, starting at -1000, incrementing by 1.
```
AbsoluteTiming@ ...
```
Find the total time elapsed in seconds.
```
p[1*^3#]&@@ ...
```
Multiply that by 1000 (seconds -> miliseconds) and `p` (`Print`) it.
[Answer]
# PHP, ~~110~~ 70 bytes
still a little long; but saved 38 with @AlexHowansky´s hint, and two more with `1e3` and `~1e3`.
```
for($t=($m=microtime)($i=~1e3);$i++<1e3;)echo"$i
";echo($m(1)-$t)*1e3;
```
prints float. Run with `-r`.
[Answer]
## Powershell, 27 Bytes
```
$1=date;-1e3..1e3;(date)-$1
```
Thanks to AdmBorkBork for pointing out that the verbose default output is acceptable in the challenge.
Outputs result like:
```
994
995
996
997
998
999
1000
Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 5
Milliseconds      : 679
Ticks             : 56799255
TotalDays         : 6.57398784722222E-05
TotalHours        : 0.00157775708333333
TotalMinutes      : 0.094665425
TotalSeconds      : 5.6799255
TotalMilliseconds : 5679.9255
```
for more contained result of just milliseconds, use original answer:
```
$1=date;-1e3..1e3;((date)-$1).TotalMilliseconds
```
Save time before as $1, print to stdout automatically, then get the time between the beginning and end of execution.
[Answer]
# [Perl 6](https://perl6.org), 45 bytes
```
.put for -($_=1e3)..$_;put (now -INIT now)*$_
```
[Try it](https://tio.run/nexus/perl6#@69XUFqikJZfpKCroRJva5hqrKmnpxJvDRLVyMsvV9D19PMMUQCyNLVU4v//BwA "Perl 6 – TIO Nexus")
## Expanded:
```
# print the values
.put             # print with trailing newline ( method call on ｢$_｣ )
for              # for each of the following
                 # ( temporarily sets ｢$_｣ to the value )
-(
  $_ = 1e3       # store ｢Num(1000)｣ in ｢$_｣
)
..               # inclusive Range object
$_;
# print the time elapsed
put              # print with trailing newline
(now - INIT now) # Duration object that numifies to elapsed seconds
* $_             # times 1000 to bring it to milliseconds
# The ｢INIT｣ phaser runs code (the second ｢now｣) immediately
# as the program starts.
# There is no otherwise unrelated set-up in this code so this is a
# reliable indicator of the amount of time it takes to print the values.
```
[Answer]
# [J](http://jsoftware.com/), 22 bytes
```
1e3*timex'echo,.i:1e3'
```
[Try it online!](https://tio.run/nexus/j#@2@paGVsHmugEA@CXKnJGfmxhqnGWiWZuakV6iCujl6mFVBE/f9/AA)
`timex` is a builtin that executes the string and returns the time it took to evaluate it in seconds. The string forms the range [-1000, 1000] using `i:`, then columinizes it using `,.`, and prints it using the builtin `echo`.
[Answer]
# [Pyth](http://pyth.herokuapp.com/), ~~18~~ ~~15~~ 14 bytes
```
j}_J^T3J;*.d1J
```
[Try it here!](http://pyth.herokuapp.com/?code=j%7D_J%5ET3J%3B%2a.d1J&debug=0)
**Explanation**
This is similar to my python answer.
```
    J^T3           Set J to 1000
  }_    J         List ranging from -1000 to 1000
j                 Join the list with new lines and implicitly print it
         ;*.d1J   Print time since execution of the program in milliseconds
```
**Edits**:
* Thanks to [fryamtheeggman](https://codegolf.stackexchange.com/users/31625/fryamtheeggman) for saving 3 bytes!
* Thanks to [busukxuan](https://codegolf.stackexchange.com/users/49362/busukxuan) for saving a byte.
[Answer]
# [Noodel](https://tkellehe.github.io/noodel/), ~~17~~ 13 [bytes](https://tkellehe.github.io/noodel/docs/code_page.html)
**13 bytes**
Tried a slightly different approach and saved 4 bytes.
```
ƇQjȥḶGQɱ⁻Ñ€Ƈ⁻
```
[Try it:)](https://tkellehe.github.io/noodel/editor.html?code=%C6%87Qj%C8%A5%E1%B8%B6GQ%C9%B1%E2%81%BB%C3%91%E2%82%AC%C6%87%E2%81%BB&input=&run=true)
### How it works
```
Ƈ             # Pushes on the amount of milliseconds passed since 01/01/1970.
 Qjȥ          # Pushes 2001 onto the stack.
 Qj           # Pushes on the string "Qj"
   ȥ          # Converts the string into a number as base 98.
    ḶGQɱ⁻Ñ€   # Loops 2001 times printing -1000 to 1000.
    Ḷ         # Consumes the 2001 and loops the following code 2001 times.
     GQ       # Pushes on the string "GQ"
       ɱ      # Pushes on the current counter of the loop (i)
        ⁻     # Subtracts (i - "GQ") since i is a number, the "GQ" is converted to a number which will fail.
              # So, Noodel will treat the string as a base 98 number producing (i - 1000). 
         Ñ    # Consume what is on the top of the stack pushing it to the screen followed by a new line.
          €   # The end of the loop.
           Ƈ⁻ # Calculates the duration of execution.
           Ƈ  # Pushes on the amount of milliseconds passed since 01/01/1970.
            ⁻ # Pushes on (end - start)
```
---
**17 bytes**
```
ƇGQȥḋɲṡ×2Ḷñ⁺1€ÑƇ⁻
```
[Try it:)](https://tkellehe.github.io/noodel/editor.html?code=%C6%87GQ%C8%A5%E1%B8%8B%C9%B2%E1%B9%A1%C3%972%E1%B8%B6%C3%B1%E2%81%BA1%E2%82%AC%C3%91%C6%87%E2%81%BB&input=&run=true)
### How it works
```
Ƈ                 # Pushes on the amount of milliseconds passed since 01/01/1970.
 GQȥḋɲṡ×2         # Used to create the range of numbers to be printed.
 GQ               # Pushes on the string "GQ".
   ȥ              # Converts the string into number as if it were a base 98 number. (which is 1000)
    ḋ             # Duplicates the number and pushes it onto the stack. 
     ɲ            # Since the item on top is already a number, makes the number negative (random thing I threw in at the very beginning when made the langauge and totally forgot it was there)
      ṡ           # Swaps the first two items on the stack placing 1000 on top.
       ×2         # Doubles 1000 producing... 2000
         Ḷñ⁺1€Ñ   # Prints all of the numbers from -1000 to 1000.
         Ḷ        # Consumes the 2000 to loop the following code that many times (now -1000 is on the top).
          ñ       # Prints the value on top of the stack followed by a new line.
           ⁺1     # Increment the value on top of the stack by 1.
             €    # End of the loop.
              Ñ   # Since 1000 is still not printed, this consumes 1000 and prints it followed by a new line.
               Ƈ⁻ # Calculates the number of milliseconds to execute program.
               Ƈ  # Pushes on the amount of milliseconds passed since 01/01/1970.
                ⁻ # Pushes on (end - start) in milliseconds.
                  # At the end, the top of the stack is pushed to the screen.
```
---
The snippet uses the values -4 to 4 in order to not take so long to complete.
```
<div id="noodel" code="ƇFȥḶAɱ⁻Ñ€Ƈ⁻" input="" cols="10" rows="10"></div>
<script src="https://tkellehe.github.io/noodel/noodel-latest.js"></script>
<script src="https://tkellehe.github.io/noodel/ppcg.min.js"></script>
```
[Answer]
# TI-Basic, 22 bytes
```
startTmr
For(A,-ᴇ3,ᴇ3
Disp A
End
startTmr-Ans
```
* Many commands are represented by 1 or 2-byte tokens.
* Tested on an emulated TI-84 CSE.
[Answer]
# Matlab, ~~16~~ 23 Bytes
```
tic;(-1e3:1e3)'
toc*1e3
```
Edit: I realised I was violating several of this challenge's rules. That'll teach me to skim read the challenge late at night. I also now realise that the corrected answer is almost identical to the Octave solution, but such is life.
Prints each element in the created linear space array -1000:1000 (the lack of ; prints to console).
tic/toc records the time and toc prints the time to the console with or without the ; . 1e3 is needed to print in milliseconds.
[Answer]
# Groovy, ~~75~~ 73 bytes
```
t=System.&nanoTime
s=t()
(-1000..1e3).each{println it}
print((t()-s)/1e6)
```
Thanks to [jaxad0127](https://codegolf.stackexchange.com/users/56408/jaxad0127) for saving 2 bytes!
[Try it here !](http://ideone.com/PJYD74)
[Answer]
# [8th](http://8th-dev.com/), ~~61~~ 47 bytes
*Thanks to [8th\_dev](https://codegolf.stackexchange.com/users/64527/8th-dev) for nice improvement* (saved 14 bytes)
```
d:msec ( . cr ) -1000 1000 loop d:msec swap - .
```
This will print all the integer numbers between -1000 and 1000 in ascending order and the time taken (in milliseconds) to print these numbers
```
-1000
-999
-998
-997
...
997
998
999
1000
4
```
[Answer]
# Japt, 23 bytes
There are two equivalent solutions:
```
Oo(Ð -(A³òA³n @OpXÃ,Ð¹n
K=Ð;A³òA³n @OpXÃ;OoÐ -K
```
The first one basically does the following:
```
output(-(new Date() - (1000 .range(-1000).map(X => print(X)), new Date())));
```
That is, the numbers are printed in the middle of the subtraction to avoid having to store the time in a variable. However, it's not any shorter than the variable route, which is basically:
```
K = new Date(); 1000 .range(-1000).map(X => print(X)); output(new Date() - K);
```
In the latest version of Japt (newer than this challenge), `K` is set up to automatically return `new Date()`. This cuts the first solution down to 21 bytes:
```
Oo(K-(A³òA³n @OpXÃK)n
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.3&code=T28oSy0oQbPyQbNuIEBPcFjDSylu&input=)
[Answer]
## [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), 34 bytes
```
d=timer[-z^3,z^3|?a]?z^3*(timer-d)
```
Uses the QBasic `TIMER` function, which returns seconds in decimal notation. Making it look pretty adds some bytes.
Explanation
```
d=timer     Set 'd' to the current # seconds since midnight
[-z^3,z^3|  FOR -1000 to 1000  --  Note that 'z' = 10 in QBIC, and z^3 saves a byte over 1000
?a          Display the iterator
]           Close the FOR loop
    timer-d Take the current time minus the time at the start of the program -- 0.156201
?z^3*()     Multiply by a thousand and display it   156.201
```
[Answer]
## C++ - 261
Just for a laugh I thought I'd post a C++ answer.
```
#include <iostream>
#include <chrono>
using namespace std::chrono; using c=std::chrono::system_clock; void p(){c::time_point n=c::now();for(int i=-1001;++i<1001;)std::cout<<i<<"\n";std::cout<<(duration_cast<milliseconds>(system_clock::now()-n)).count()<<"\n";}
```
I'll leave it as an exercise to determine what it is doing and how to call it - shouldn't be too difficult.
[Answer]
# Scala, 77 bytes
```
def t=System.nanoTime
val s=t
Range(-1000,1001)map println
println((t-s)/1e6)
```
[Answer]
# ForceLang, 124
```
set t timer.new()
set i -1000
label 1
io.writeln set i i+1
if i=1000
 io.write math.floor 0.001.mult t.poll()
 exit()
goto 1
```
Note: You should supress `stderr` when running this. I believe the consensus on meta is that this does not incur a byte count penalty.
[Answer]
# [SimpleTemplate](https://github.com/ismael-miguel/SimpleTemplate), 92 bytes
What really killed me was the need to record the time.
```
{@callmicrotime intoX 1}{@for_ from-1000to1000}{@echol_}{@/}{@phpecho microtime(1)-$DATA[X]}
```
Since there's no math (yet), this makes things pretty hard, forcing me to write PHP directly.
**Ungolfed:**
```
{@call microtime into start_time true}
{@for i from -1000 to 1000 step 1}
    {@echol i}{@// echoes a newline after}
{@/}
{@php echo microtime(true) - $DATA["start_time"];}
```
---
**Disclaimer:**
I've ran this with the commit [e118ae72c535b1fdbe1b80c847f52aa161854fda](https://github.com/ismael-miguel/SimpleTemplate/tree/e118ae72c535b1fdbe1b80c847f52aa161854fda), from 2017-01-13.
The latest commit was to fix something that is un-related to the code in here.
[Answer]
## C ~~134~~ 133 bytes
Thanks to @Thomas Padron-McCarthy for saving 1 byte.
```
f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}
```
Ungolfed version :
```
void f()
{   
  clock_t s,e;
  s=clock();
  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);   
  e=clock();
  printf("%f",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);
 }
```
[Answer]
# [Gura](https://github.com/gura-lang/gura), 75 bytes
```
t=datetime.now();println(-1000..1000);print((datetime.now()-t).usecs/1000);
```
[Answer]
# Clojure, 94 bytes
```
(let[t #(System/currentTimeMillis)s(t)](doseq[n(range -1e3 1001)](println n))(println(-(t)s)))
```
I'm disappointed at how long this got, but I guess no one ever claimed Clojure was a good language to golf in.
Naïve solution that just records the starting time, loops, then prints the current time minus the starting time. Unless Clojure has a ms-time getter than I'm missing, I don't know how this could get any shorter. Maybe some kind of implicit loop?
```
(defn time-print []
  (let [t #(System/currentTimeMillis) ; Alias the time-getter to "t"
        start (t)] ; Record starting time
    (doseq [n (range -1000 1001)] ; Loop over the range...
      (println n)) ; ... printing the numbers
    (println (- (t) start)))) ; Then print the current time minus the starting time.
```
]