php - Calculate time passed variable to use in $.get() -


I am trying to update my database with some information. One of the major pieces of information is how much time has passed since the first page load, and when the user clicks on a button, my code looks like this:

    

and

  & lt; Html & gt; & Lt; Div id = "pause" onclick = "pause video ()" & gt; PAUSE & lt; / Div & gt; & Lt; / Html & gt; My PHP is okay so ignore it. The part I'm having trouble with is time passard. I should have it in seconds because the page was already loaded and Person clicks on PAUSE Debit  

I think that I need to run a function to click and find the time to pass and then use that time in the $ .get () variable Also like?

Something like this:

  var startTime = (new date). GetTime () / 1000; Function pause video () {var curtime = (new date) .getTime () / 1000; Var Time Passed = Math Floor (Curtaium - Starttime); $ .get ("video_pause.php? Pause =" + time passed + "& amp; videoid = & lt ;? php echo $ _GET ['sessionid'] ;? & gt; sessionid = & lt; php Echo $ _GET ['videoid'];; & gt;;); }    

Comments