Create a TimeSpan instance, specifying the number of ticks

image_pdfimage_print
   
 

using System;

class MainClass {

    public static void Main() {
        int hours = 4;
        int minutes = 12;
        int seconds = 10;

        int days = 1;

        int milliseconds = 20;

        long ticks = 300;
        TimeSpan myTimeSpan4 = new TimeSpan(ticks);
        Console.WriteLine("myTimeSpan4 = " + myTimeSpan4);
    }
}