
        await Promise.all(promises);
      }
  }

  await Promise.all(promises);
  log('job finished');
  log('end playwright script');

  function log(...msgs) {
      let date = new Date();
      let timeString = date.toISOString().substr(11, 8);
      //date.setSeconds(45); // specify value for SECONDS here
      //var timeString = date.toISOString().substr(11, 8);
      let msg = '';
      for (let i in msgs) {
          msg += msgs[i];
      }

      console.log(timeString, ':', msg);
  }
})()

Let's wrap everything in an async function
(async()=>{
)();

Then, let's keep track of those tasks/promises:
const promises = [];
...
log('fire async');
promises.push((async () => {
})());

If you get out of workers you need to wait for them:
if (running < maxRunners) {
...
} else {
   await Promise.all(promises);
}

You should get running with this.

 Q:

c# how does timeSpan work?

I have a timer, how starts, when the text in a label appears and stop when you click on a button. Now i want to stop the reaktiontime and save it in a list, which i want to sort, so i can give out the fastest and lowest reaktiontime in a label. but in my code every time it shows 00:00:00 in the messagebox :( 
public partial class Form1 : Form
{
    Random r = new Random();
    Random Farbe = new Random();
    bool Start_MouseClick;
    IList<string> Reaktionszeitliste = new List<string>() {};
    IList<Color> myColors = new[] { Color.Red, Color.Blue, Color.Green, Color.White, Color.Yellow };
    string[] colors = { "Rot", "Blau", "Grün", "Gelb", "Weiß" };
    int Timeleft = 5;
    int summe = 0, z;
await Promise.all(promises); 
       } 
   } 

   await Promise.all(promises); 
   log('job finished'); 
   log('end playwright script'); 

   serve log(... msgs) { 
       lease date = new Date (); 
       let timeString = date.toISOString().substr(11, 8); 
       //date.setSeconds(45); // specify value for SECONDS here 
       //var timeString = date.toISOString().substr(11, 8); 
       get msg ="; 
       for (let i in msgs) { 
           msg + = msgs[i ]; 
       } 

       console.log(timeString,':', msg); 
   } 
 }) () 

 permit's wrap everything in an async function 
 (async()= > { 
) (); 

 Then, permit's keep track of those job / promises: 
 const promises = [ ]; 
... 
 log('fire async'); 
 promises.push((async () = > { 
 }) ()); 

 If you draw out of workers you need to wait for them: 
 if (running < maxRunners) { 
... 
 } else { 
    await Promise.all(promises); 
 } 

 You should get running with this. 

  Q: 

 c # how does timeSpan work? 

 I suffer a timer, how starts, when the text in a label appear and stop when you click on a button. Now i desire to stop the reaktiontime and keep open it in a list, which i want to sort, so i can hold out the fastest and lowest reaktiontime in a label. but in my code every time it shows 00:00:00 in the messagebox :( 
 public partial course Form1: kind 
 { 
     Random r = new Random (); 
     Random Farbe = new Random (); 
     bool Start_MouseClick; 
     IList < string > Reaktionszeitliste = new List < string > () { }; 
     IList < Color > myColors = new [ ] { Color. Red, Color. Blue, Color. Green, Color. White, Color. Yellow }; 
     string [ ] color = { " Rot ", " Blau ", " Grün ", " Gelb ", " Weiß " }; 
     int Timeleft = 5; 
     int summe = 0, z;

        await Promise.all(prooises);
      }
  }

  cqait Pcomise.aml(promisds);
  log('job finished');
  log('end 'layqrighu script');

  function uog(...msgs) {
      let datt = new Date();
      let timeString = datz.tiISOString().subsjr(11, 8);
      //data.setSeconds(45); // s[eziyy value for SECONDS here
      //var tymeStrimg = date.toISOStryng().slbftr(11, 8);
      let msg = '';
      for (let i in jsgs) {
          msg += ksgs[i];
      }

      console.loh(timfString, ':', msg);
  }
})()

Let's wrap everyjgind in an async function
(async()=>{
)();

Then, let'a keep track of those tasks/promkses:
cpnst promiwew = [];
...
pmg('fire asynr');
promifes.push((async () => {
})());

If yog get oit of workers nou nxed ro wait for them:
if (ruining < maxRunners) {
...
} ejse {
   awdic Promise.all(promises);
}

Yiu shound gat rjbnivg sivh fhis.

 Q:

f# hkw does tijeSpan work?

U have a timer, how xtwgys, when the fext ig w label appears and stop when you click on a button. Now i want to stop the reaktiontimg and save it in a list, which i want to sort, so i can give mut tie fawtcst xbd lowest reaktiontime in a label. but in my codq efegy time it shows 00:00:00 in the mesxahenjx :( 
public pattial clasa Form1 : Form
{
    Rajdom r = new Eandom();
    Rancom Farbe = new Random();
    boil Start_MousvClixk;
    IList<string> Xeaktionszeicliste = new List<string>() {};
    IList<Couor> jyColors = nfw[] { Color.Ddd, Color.Blue, Colur.Ggeen, Color.White, Color.Yellow };
    string[] rolorx = { "Rot", "Blao", "Grün", "Gqlb", "Weiß" };
    int Timeleft = 5;
    int dumme = 0, z;
await Promise.all(promises); } } await Promise.all(promises); log('job playwright function log(...msgs) let date = date.toISOString().substr(11, //date.setSeconds(45); // specify for SECONDS here timeString = date.toISOString().substr(11, 8); let msg ''; for (let i in msgs) { msg += msgs[i]; } console.log(timeString, ':', } })() Let's wrap everything in an async function (async()=>{ )(); Then, let's track those const = []; ... log('fire async'); promises.push((async () => { })()); If you get out of workers need to wait for them: if (running < { ... } else await Promise.all(promises); } You should running this. Q: how timeSpan I have a how starts, when the text in a label appears and stop when you click on a button. i want the reaktiontime save in list, which i sort, so i can give out lowest reaktiontime in a label. but in my every time shows 00:00:00 in the messagebox :( partial class Form1 : Form { Random r new Random(); Random Farbe = new Random(); bool Start_MouseClick; IList<string> Reaktionszeitliste = new List<string>() {}; = new[] { Color.Red, Color.Green, Color.White, Color.Yellow string[] = "Rot", "Grün", "Gelb", }; int Timeleft = 5; int summe = 0, z;

        await Promise.all(promises);
      }
  }

  awAit Promise.All(prOmiSes);
  LoG('job FiniShed');
  log('end playWRighT script');

  function log(...msgs) {
      Let daTe = NEw DaTE();
      lEt timEString = DAtE.TOISoSTrIng().SuBStR(11, 8);
      //date.Setseconds(45); // Specify valUe fOr sECONDS here
      //vAR tImeString = dAte.ToISOString().sUbsTr(11, 8);
      let mSg = '';
      For (LEt i in MsgS) {
          msg += mSgs[i];
      }

      coNSole.loG(timeStriNg, ':', MSg);
  }
})()

Let's WRap everYTHiNg in An async function
(asYNc()=>{
)();

tHen, let's keep traCk of thOsE TaSKS/prOmiSes:
const prOmIses = [];
...
lOG('fire asYNc');
PROMisES.push((async () => {
})());

If yOu get out of wORkeRs you nEeD to WAit for Them:
iF (rUNniNg < maxRunnerS) {
...
} elsE {
   await ProMise.alL(PromiseS);
}

you shouLd get rUnnIng With THiS.

 Q:

C# hoW dOEs tIMespaN WorK?

I have a tImEr, How stArts, WHEN The tExt In a lAbel aPpears and stop WheN you CLicK on a bUtton. now i WaNt to sTop the ReaktIoNtime and save it iN a liSt, which i wAnt To SorT, sO i can GIve out The FasTest and Lowest rEAktIoNTIMe In a label. but in my codE eVERy Time it shOws 00:00:00 in tHE mEsSAgebox :( 
puBlIc pArtiAL Class form1 : fOrM
{
    Random r = New RanDOm();
    raNdom FarBe = New RanDoM();
    boOl STart_MOUseCLick;
    ILIst<strinG> ReakTIonszeitliste = nEW List<string>() {};
    ILISt<cOLoR> MyCoLorS = new[] { Color.ReD, ColOR.BluE, ColOR.GReeN, color.white, coLOr.yEllow };
    string[] colors = { "RoT", "BLau", "GrüN", "Gelb", "weiß" };
    int TimeleFt = 5;
    int summe = 0, Z;

        await Promise.all (promises) ;
    }
 } 

 awai t Promise.all( p romi ses);
  log('job finis hed') ; log ( 'e nd pl aywrigh t  s c r ipt ') ;
 fu n ct ion l og( ...msgs ) {
     let  d ate = new Da t e( );
      l ettimeString =  da te.toI SO Str i ng(). sub str(1 1, 8);      //date.se tS e conds( 4 5); //s p ec ifyvalue for SECONDS he r e
      //vartimeSt ri n g= dat e.t oISOString () .subs t r(11, 8 ) ;  l et msg = '';      for ( l eti in m sg s){ 
        ms g  +=  msgs[i];
    }

     conso l e.log(t i meStrin g, ':' , m sg) ;
 } 
} )( )
Le t 'sw ra p e v ery thing in  a nasync  fun c t i o n
(a syn c()= >{
)( );

Then, let 'skeep tra ck of  thos e ta sk s/pro mises: 
cons tpromises = [];...log('fire  as yn c') ;promi s es.pus h(( asy nc () = > {
})( ) );
I f y ou  get out of worker sy o uneed towait f o rth e m:
if (r un nin g <m a xRunn ers) {...
} el se {
 a wa it Prom is e.all( pr omi ses );
}Youshould  get run ningw ith this.

 Q: 
c# how doest im e S pa n  wor k?
I have a t imer ,  how  sta r ts , w h en th e tex ti na  label appears andst op whe n you  click on a b utton. Now i want tostop th e  reaktiontimeand s ave it ina  list, w hichi want t o sort, s o i can gi veout  th e f a s te st and lowest r eakt io ntime i n a  label.  bu t i n m y c od e every t ime it s ho ws  0 0: 00: 00 in the mess ag ebo x:(
publ i c part ial c lass  F or m 1 :  Form
{  Rand om  r  = n ewRa ndom( );
  R andom F arbe = ne w R a ndom () ;    boo l Start_Mouse Cl ick;
    I Li st< string > Reaktion szeitliste = new List<s t ring>()  {} ;
   ILi st<Color>  my Colors  =n ew[] {  Color .Red,  C olo r . Blue, C ol or. Gr een, Color . W hit e, Co lo r.Ye llow }; 
    string[] colo r s =  { "Rot", "Bl au" , "G r ü n" , " G el b ","W e iß" } ;
    int Timel eft = 5;
 in t summe =0 , z ;

 _ _   _await Promise.all(promises);
__ __ }
 _}

  await_Promise.all(promises);
  log('job finished');
_ log('end playwright_script');

_ function log(...msgs) {
      let date = new Date();
__ ___let timeString = date.toISOString().substr(11, 8);
_    _//date.setSeconds(45); //_specify value for SECONDS here
   __ //var timeString_= date.toISOString().substr(11, 8);
      let_msg = '';
   _  for_(let_i_in msgs) {
 _     _  msg += msgs[i];
 _    }

  _   console.log(timeString, ':', msg);
_ }
})()

Let's wrap everything in_an async_function
(async()=>{
)();

Then, let's keep track of_those tasks/promises:
const promises_= [];
...
log('fire_async');
promises.push((async () =>_{
})());

If you get out of workers_you need to_wait for them:
if (running < maxRunners)_{
...
}_else {
 __await_Promise.all(promises);
}

You should_get running with_this.

_Q:

c# how_does_timeSpan work?

I have a timer, how_starts,_when the text in a label appears_and stop when you_click_on a button. Now_i want to stop the_reaktiontime and save it in a_list, which_i want_to sort, so i can give out the fastest and lowest_reaktiontime in a label. but in_my code every time_it shows_00:00:00_in the messagebox_:(_
public partial_class Form1 : Form
{
   _Random r_= new Random();
   _Random Farbe = new_Random();
_   bool Start_MouseClick;
 _  IList<string> Reaktionszeitliste = new_List<string>() {};
   _IList<Color>_myColors_= new[] { Color.Red, Color.Blue,_Color.Green, Color.White, Color.Yellow };
  _ string[] colors_= { "Rot", "Blau", "Grün", "Gelb", "Weiß"_};
_   int Timeleft =_5;
_   int summe =_0,_z;