Creating a Project Icon from Scratch

 

Overview

The process for integrating timers and clocks into modern computer programs has been greatly simplified in the last 10 years because the newer operating systems include the system software necessary to incorporate local time into everyone s computer. There are only two tasks assigned to PC timekeeping software:

  • Reporting time quickly (called Now time) for display on one s PC screen or for time-stamping programs and files as soon as they are created. Word processors were the first to include time-stamping software, and today it is found in most commercial software packages.

  • Operating a timer that measures elapsed time and informs the user when some benchmark time is reached. Even the simplest handheld portable games sold in toy stores have timers that shut down the game process when some agreed-to time has expired .

Before we examine a program that uses both real time and a timer, we should mention a Microsoft innovation that first appeared in the Visual C# compiler: a Sleep statement. It is not used often, but it has great utility in learning situations when the instructor must insert periods of time in source code to aid the students in the learning process. It also comes in handy in the debug process if the programmer needs to slow down a process to examine all of its ramifications .

The Sleep statement works this way:

 using System.Threading; 

This places the proper software in the code.

 Thread.Sleep(10000); 

Sleep for 10 seconds, then proceed.

Sleep does not inhibit any central processing unit (CPU) activity like MessageBox does, so it is useful on special occasions.

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net