Mega Code Archive

 
Categories / C# Tutorial / Date Time
 

Check the current second

using System;     class MainClass     {         static void Main(string[] args)         {             int sec = -1;             while( DateTime.Now.Second != 0 )             {                 if( sec != DateTime.Now.Second )                 {                     sec = DateTime.Now.Second;                     Console.Write( "...{0}", 60-DateTime.Now.Second );                 }             }         }     }