/blog_csharp_stopwatch_1.cs Secret
Created
September 23, 2022 23:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; // 필요함. | |
class Program | |
{ | |
public static void Main() | |
{ | |
Stopwatch sw = new Stopwatch(); // 스탑워치 전용 인스턴스 생성 | |
Console.WriteLine("Start...!!"); | |
sw.Start(); // 시간 측정 시작 | |
Thread.Sleep(2200); // 2.2sec 대기 | |
Console.WriteLine("Wait..."); | |
sw.Stop(); // 시간 측정 끝 | |
Console.WriteLine($"Time : {sw.ElapsedMilliseconds}ms"); // | |
} | |
} |
Author
BlockDMask
commented
Sep 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment