Returns in milliseconds that is passed from January 1, 1970
We have to use this along with one date object.
Here is an example
<script type="text/javascript"> 
var my_time = new Date(); // date object 
document.write(my_time.getTime()); // Output 
Output is here Using a button to display getTime() of current date object.

Source of this demo is here
<script type="text/javascript"> 
function show_gettime(){
var my_time = new Date(); // date object 
//document.write(my_time.getTime()); // Output 
document.getElementById('display').innerHTML = my_time.getTime();

<input type=button onclick='show_gettime()' value='Show';>

<div id='display'></div>

Calculating Process time or lapse time

By using gettime() we can find out time taken by any calculation or any other process by finding the difference in milliseconds from start and end of the process.

Calculate the Process duration

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer