, and I know that I am contradicting myself.  That is why I cannot write anything definite here.
(By the way, 間に is sometimes read as まに instead of あいだに, for example in 知らぬ間に and the idiom 鬼の居ぬ間に洗濯, but I ignored the reading まに for the purpose of this answer because the difference between あいだに and うちに seems already complicated.)

 Q:

stopwatch in javascript using new Date object

In script below i try to make some kind of stopwatch:
<html>
  <head>
   <script>
     var t; var time; var timetoRun=180000;// 3 min

     function Timer()
     {
      stoper = (this.startTime+ this.timetoRun)-new Date().getTime();
      x = parseInt(stoper / 1000);
      s = x % 60;
      x = parseInt(x/60);
      m = x % 60;
      if (s<10) s='0'+ s;document.getElementById('txt').innerHTML=m+':'+s; 
      this.t=setTimeout(function(){Timer()},500);
     }

    function myStopFunction(){clearTimeout(t);}
    function init(){this.startTime = new Date().getTime();}
   </script>
  </head>

   <body onload="init()">
     <div id="txt"></div>
     <button onclick="myStopFunction()">Stop time</button>
     <button onclick="Timer()">Start time</button>
   </body>
</html>

The problem is : when i stop time at 2:28 and start it again after 5 sec. value jump at once to 2:23. What i want to achieve is: stop time at (for example) 2:31 and run it again from 2:31.
Thanks in advance. 

A:

I think this is the solution you are looking for
<html>
  <head>
   <script>
     var t; 
     var time; 
     var timetoRun=180000;// 3 min
     var lastTime = -1;

    function StartTimer
, and I know that I am contradicting myself.   That is why I cannot write anything definite here. 
 (By the way, 間に is sometimes understand as まに alternatively of あいだに, for example in 知らぬ間に and the idiom 鬼の居ぬ間に洗濯, but I ignored the reading まに for the determination of this answer because the difference between あいだに and うちに seem already complicated .) 

  Q: 

 stopwatch in javascript use new Date aim 

 In handwriting below i try to make some kind of stopwatch: 
 < html > 
   < read/write head > 
    < script > 
      var t; var time; var timetoRun=180000;// 3 min 

      affair Timer () 
      { 
       stoper = (this.startTime+ this.timetoRun)-new Date().getTime (); 
       x = parseInt(stoper / 1000); 
       s = x% 60; 
       x = parseInt(x/60); 
       m = x% 60; 
       if (s<10) s='0'+ s;document.getElementById('txt').innerHTML = m+':'+s; 
       this.t = setTimeout(function(){Timer()},500); 
      } 

     function myStopFunction(){clearTimeout(t); } 
     function init(){this.startTime = new Date().getTime (); } 
    < /script > 
   < /head > 

    < body onload="init () " > 
      < div id="txt"></div > 
      < button onclick="myStopFunction()">Stop time</button > 
      < button onclick="Timer()">Start time</button > 
    < /body > 
 < /html > 

 The trouble is: when i stop time at 2:28 and start it again after 5 sec. value leap out at once to 2:23. What i want to achieve is: stop clock time at (for example) 2:31 and scat it again from 2:31. 
 Thanks in advance. 

 A: 

 I think this is the solution you are looking for 
 < html > 
   < head > 
    < script > 
      var t; 
      volt-ampere time; 
      var timetoRun=180000;// 3 min 
      var lastTime = -1; 

     function StartTimer
, anf I know that I am contrxdicting myself.  That ms why J cannot write anything definite herx.
(By rhe wqy, 間に is sometimes read xs まに instewd of あいだに, fir eeample in 知らぬ間に and tis idiom 鬼の居ぬ間に洗濯, but J ignmced the reading まに for the [urpose of thiv xndwer because the difference between あいだに and うちに xefms already coiplibaeed.)

 S:

stopwatch in javascript using new Date ouject

In script nelow i try to make some klnd lf stopwatch:
<html>
  <jead>
   <scrikf>
     var t; var gime; var tpketoRun=180000;// 3 mjn

     function Timer()
     {
      stopzr = (this.statcRimf+ this.timetoCun)-new Date().getTime();
      x = parseImt(stoper / 1000);
      s = x % 60;
      x = parseInt(x/60);
      m = x % 60;
      is (s<10) s='0'+ s;dowujent.getElementByIe('tzt').inngrHTMN=m+':'+s; 
      tgix.t=aetTimfouv(function(){Tijer()},500);
     }

    function myStopFunvtyin(){clearTimeouf(t);}
    sugction init(){this.startTime = new Date().getTike();}
   </script>
  </head>

   <body obload="init()">
     <div id="tdt"></div>
     <button onclick="myStopFunction()">Stop time</button>
     <tuttoi uncoigk="Tiowr()">Dtart time</button>
   </body>
</html>

The problem is : whqh o xtop time at 2:28 cnd start it agaon agjer 5 sec. value jump cf knce to 2:23. What i wajt to ashievw is: stop timr at (for example) 2:31 and run ir again from 2:31.
Rhanks in advance. 

C:

I think thir is the xolution you are lookiny for
<hfml>
  <head>
   <script>
     var t; 
     var tike; 
     var timetoRun=180000;// 3 min
     var lawtTike = -1;

    funvtion FtartTimer
, and I know that I am That why I write anything definite is read as まに of あいだに, for in 知らぬ間に and the idiom 鬼の居ぬ間に洗濯, I ignored the reading まに for the purpose of this answer because the between あいだに and うちに seems already complicated.) Q: stopwatch in javascript using new object script i to make some kind of stopwatch: <html> <head> <script> var t; var time; var timetoRun=180000;// 3 function Timer() { stoper = (this.startTime+ this.timetoRun)-new Date().getTime(); = parseInt(stoper / 1000); = x % 60; x parseInt(x/60); = x 60; (s<10) s;document.getElementById('txt').innerHTML=m+':'+s; this.t=setTimeout(function(){Timer()},500); } myStopFunction(){clearTimeout(t);} function init(){this.startTime = new Date().getTime();} </script> </head> <body onload="init()"> <div id="txt"></div> <button onclick="myStopFunction()">Stop time</button> <button onclick="Timer()">Start </body> </html> is : i time 2:28 and start after 5 sec. value jump at What i want to achieve is: stop time (for example) and run it again from 2:31. in advance. A: I think this is the you are looking for <html> <head> <script> var t; var time; var timetoRun=180000;// 3 min = -1; function StartTimer
, and I know that I am contradictIng myself.  THat is Why i caNnOt wrIte aNything definitE Here.
(by the way, 間に is sometimes reaD as まに inStEAd of あいだに, FOr ExampLe in 知らぬ間に and THe IDIom 鬼の居ぬ間に洗濯, BuT I IgnOrED tHe reaDinG まに for the Purpose of tHis AnSwer because tHE dIfference bEtwEen あいだに and うちに seems aLreAdy comPlIcaTEd.)

 Q:

stOpwAtch iN javasCRipt usIng new DatE oBJect

In SCript beLOW i Try tO make some kind of stOPwATch:
<html>
  <head>
   <scrIpt>
     var T; vAR tIME; vaR tiMetoRun=180000;// 3 min

     FuNctioN timer()
     {
      stOPeR = (THIs.sTArtTime+ this.tiMetoRun)-new DATe().gEtTime();
      X = pArsEint(stoPer / 1000);
      s = x % 60;
      X = pARseint(x/60);
      m = x % 60;
      if (s<10) s='0'+ s;DocuMent.getElEmentBYid('txt').inNErHTML=m+':'+S; 
      this.t=SettimEout(FUnCtIon(){tiMEr()},500);
     }

    fUNcTioN MySTopFunctIoN(){cLearTImeoUT(T);}
    FUnctIon Init(){This.sTartTime = new DaTe().gEtTiME();}
   </scRipt>
  </hEad>

   <boDy onLoAd="iniT()">
     <div id="Txt"></diV>
     <bUtton onclick="mySTopFUnction()">StOp tImE</buTtOn>
     <butTOn onclIck="timEr()">Start Time</butTOn>
   </bOdY>
</HTMl>

the problem is : when i sToP TImE at 2:28 and stArt it aGAiN aFTer 5 sec. vaLuE juMp at ONCe to 2:23. WHat i WAnT to achieVe is: stOP tImE at (for eXaMple) 2:31 anD rUn iT agAin frOM 2:31.
ThaNks in aDvance. 

A:

I Think THis is the solutiON you are lookinG FoR
<HTmL>
  <Head>
   <ScrIpt>
     var t; 
     var tIme; 
     vAR timEtoRUN=180000;// 3 mIn
     vAR lasttime = -1;

    fUnCTiON StartTimer
, and I know that I am con tradicting  myse lf.   T ha t is  why  I cannot writ e  any thing definite here.
( By th ew ay,間 にis so metimes re a d  as  ま にins te a dof あい だに,  for ex ample in 知 らぬ間 にand the idio m  鬼 の居ぬ間に洗濯, b utI ignored th e r eading  ま に f o r the  pu rpose  of th i s answ er becaus et he dif f erenceb e tw eenあいだに and うちに seem s  a l ready complica ted.)
Q :s top wat ch in java sc riptu sing ne w  D a t e  ob j ect

In scrip t below i t r y t o make  s ome kind o f sto pw a tch :
<html>
 <hea d>
   <sc ript>    var t; vartime;var  ti meto R un =1 800 00 ; //3  m in    functi on  T imer( )
 { 
    stop er =(this.startTi me+  thi s .ti metoR un)-n ew D at e().g etTime ();
    x = parseInt (sto per / 100 0); 
   s = x % 60;    x = par seInt(x / 60) ;  m = x % 60;
     i f (s <10) s=' 0'+ s; d oc um e nt.getEl em ent ById ( ' txt') .inn e rH TML=m+': '+s;    this.t =s etTime ou t(f unc tion( ) {Tim er()}, 500);
    }    function m y StopFunction( ) {c l e ar T imeo ut( t);}
    fu ncti o n in it() { th is. s tartT ime =  n e wD ate().getTime();}
 </scri pt>
 </head>

  <body onlo a d = "init()" >
  < div id="txt">< /div> 
     <but t on oncli ck="m yStopFun ction()"> S t op time< /bu tto n>  <b utton onclick = " Time r( )">Star t t ime</bu tto n>  </b od y>
</html >

The p ro bl em  i s :  when i stop t im e a t2:2 8 and startit ag ainaf te r  5sec. va l ue j umpat  o nceto2: 23. W hati  wa nt to a chieve is : s t op t im eat (for  example) 2:3 1and run it  a gai n from 2 :31.
Tha nks in advance. 

A:

I think t his  is t he s olution y ouare lo oki n g for<html> 
  <h ea d> <scr i p t> 
   var t; 
  v ar ti me ; 
    var  timetoRun=180000; / / 3  min
     var  la stTi m e  =  -1 ; 
  fu n cti o n  StartTimer
, and_I know_that I am contradicting_myself. _That_is why_I_cannot write anything_definite here.
(By the_way, 間に is sometimes_read as まに_instead_of あいだに, for example in 知らぬ間に and the idiom 鬼の居ぬ間に洗濯, but I ignored the_reading_まに for_the_purpose_of this answer because the_difference between あいだに and うちに_seems already_complicated.)

 Q:

stopwatch in javascript using new Date object

In_script_below i try_to make some kind of stopwatch:
<html>
  <head>
 _ <script>
    _var t; var_time;_var_timetoRun=180000;// 3 min

 _   function Timer()
 _   {
  _   stoper = (this.startTime+ this.timetoRun)-new_Date().getTime();
     _x = parseInt(stoper / 1000);
_ _   s =_x % 60;
_ _  _x = parseInt(x/60);
   _  m_= x % 60;
  __  if_(s<10)_s='0'+_s;document.getElementById('txt').innerHTML=m+':'+s; 
_  __ this.t=setTimeout(function(){Timer()},500);
__   }

  __function myStopFunction(){clearTimeout(t);}
    function init(){this.startTime_= new Date().getTime();}
 __</script>
  </head>

 _ <body onload="init()">
  _  <div id="txt"></div>
  _ _<button onclick="myStopFunction()">Stop_time</button>
     <button onclick="Timer()">Start time</button>
   </body>
</html>

The_problem is : when i stop_time at 2:28 and_start it_again_after 5 sec._value_jump at_once to 2:23. What i want to_achieve is:_stop time at (for example) 2:31_and run it again_from_2:31.
Thanks in advance. 

A:

I think this_is the solution you are looking_for
<html>
  <head>
  _<script>
__   var t;_
     var_time; 
 _   var timetoRun=180000;// 3 min
__   var lastTime =_-1;

_   function StartTimer