Operativsystem: .............................................................
Operativsystem: .............................................................
Operativsystem: .............................................................
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
}<br />
}<br />
t+=i*44/67;<br />
}<br />
//Vi måler igen tiden i et nyt nu:<br />
DateTime nu1=DateTime.Now;<br />
Console.WriteLine("\nSecond: nu1: {0}",nu1.Second);<br />
Console.WriteLine("Millisecond: nu1: {0}",nu1.Millisecond);<br />
Console.WriteLine("Ticks: nu1: {0}",nu1.Ticks);<br />
//Hvor lang tid er der gaaet?<br />
Console.WriteLine("Ticks: nu1-nu: {0}",nu1.Ticks-nu.Ticks);<br />
Console.WriteLine("Millisecond: nu1-nu: {0}",nu1.Millisecond-nu.Millisecond);<br />
Console.Read();<br />
Forskellen mellem de 2 tidsmålinger er altså 50 milli sekunder (1 millisekund er 1/1000 sekund)<br />
eller 500.000 Ticks.<br />
En bestemt dato kan oprettes fx sådan:<br />
En ny dato kan oprettes sådan:<br />
DateTime dato=DateTime.Parse("24-12-2003 12:00:00");<br />
Console.WriteLine("LongDate: dato: {0}",dato.ToLongDateString());<br />
Console.WriteLine("LongDate: dato: {0}",dato.ToLongTimeString());<br />
//Gaa en maaned frem:<br />
DateTime ny=dato.AddMonths(1);<br />
//To timer senere: