starttime=(new Date()).getTime();
endtime=(new Date()).getTime();
(endtime-starttime )/1000
will give a value.What is this value and why is it divided by 1000
That code is calculating the number of seconds that have elapsed between two dates. The division by 1000 is there because the getTime() method returns a value measured in millseconds.
The code is actually needlessly long-winded. To get the milliseconds that have elapsed between two Date objects, you can just use the - operator on the Dates themselves:
var start = new Date();
// Some code that takes some time
var end = new Date();
var secondsElapsed = (end - start) / 1000;