#Java 7, 125 bytes
Java 7, 125 bytes
void c(){long x=System.nanoTime(),i=-1001;for(;i<1e3;)System.out.println(++i);System.out.println((System.nanoTime()-x)/i/i);}
Ungolfed:
void c() {
long x = System.nanoTime(),
i = -1001;
for(; i < 1e3; ){
System.out.println(++i);
}
System.out.println((System.nanoTime() - x) / i / i);
}
Test code:
class M{
static void c(){long x=System.nanoTime(),i=-1001;for(;i<1e3;)System.out.println(++i);System.out.println((System.nanoTime()-x)/i/i);}
public static void main(String[] a){
c();
}
}
Example output:
-1000
-999
...
...
...
999
1000
13