Date and time continuous Learn programming Visual Basic (VB.net)



Lesson:

Additional Libraries


Exercise:

Date and time continuous


Objetive:

Create a program that shows the current time in the top-right corner of the screen with the format:

12:52:03

The program should pause for one second and then display the time again in the same location.


Code:

Imports System
Imports System.Threading
Class DateAndTimeContinuos
    Private Shared Sub Main()
        While True
            Dim time As String = DateTime.Now.ToLongTimeString()
            Console.SetCursorPosition(72, 1)
            Console.Write(time)
            Thread.Sleep(1000)
        End While
    End Sub
End Class



Juan A. Ripoll - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.