두 시간 사이의 간격을 계산하기 위해서 DateTime 과 TimeSpan 을 사용할 수 있다. DateTime 은 측정하려는 두 시간을 구할 때 사용한다. TimeSpan 은 두 시간 사이의 간격을 계산할 때 사용한다. 아래 예제를 보자. using System; using System.Threading; namespace ThreadTest { class Program { static void Main(string[] args) { int result; int signature; TimeSpan oneSecond = TimeSpan.FromSeconds(1); Console.WriteLine(oneSecond); for (int i = 0; i < 10; i++) { DateTime old = Dat..
Thread.Sleep() 을 사용하면 일정 시간 동안 Thread를 멈출 수 있다. TimeSpan.FromSeconds() 을 사용하면 편하게 milli second 계산을 할 수 있다. 아래 예제를 살펴보자. using System; using System.Threading; namespace ThreadTest { class Program { static object locker = new object(); static void Main(string[] args) { new Thread(Go).Start(); for (int i = 0; i < 20; i++) { Console.Write("."); Thread.Sleep(TimeSpan.FromSeconds(1)); } } static void ..
thread의 실행을 컨트롤하기 위해서 locker를 사용할 수 있다. locker는 오로지 lock을 하는 용도로만 쓰인다. 아래 예제를 살펴보자. using System; using System.Threading; namespace ThreadTest { class Program { static object locker = new object(); static void Main(string[] args) { new Thread(Go).Start(); lock (locker) { for (int i = 0; i < 500; i++) { Console.Write("."); } } } static void Go() { lock (locker) { for (int i = 0; i < 500; i++) { C..
- Total
- Today
- Yesterday
- AxWebBrowser
- windows
- AdSense감추기
- Phalanger
- Microsoft
- .net framework
- iTextSharp
- 애드센스감추기
- Automation
- Regular Expressions
- jre
- 애드센스숨기기
- Service pack
- DotNetMagic
- ScreenHunter
- READYSTATE_COMPLETE
- AdSense숨기기
- registry
- autohotkey
- java
- 유틸리티
- c#
- 스크린캡쳐
- tagREADYSTATE
- download.com
- Rollback Rx
- Sample Code
- iText
- WinAutomation
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |