일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- WPF
- commit
- .net
- C#
- IValueConverter
- tls
- 코딩테스트
- string
- algorithm
- log
- git
- convert
- Github
- chashtag
- Microsoft
- mysql
- nullable
- Process
- windows10
- coding-test
- File
- Coding
- ListView
- windows
- dotNET
- logging
- programmers
- Binding
- Visual Studio
- csharp
Archives
- Today
- Total
목록stopwatch (1)
CHashtag
[C#] 실행시간 측정하기 (Stopwatch)
안녕하세요. 오늘은 C#에서 특정 부분의 실행 시간을 측정하는 방법에 대해 알아보로독 하겠습니다. 이 기능은 프로그램의 느린 지점을 찾거나, 더 효율적인 구현 방법을 탐구할 때에 주로 사용됩니다. using System.Diagnostics; public void SomeLogic() { Stopwatch sw = new Stopwatch(); sw.Start(); // logic in here sw.Stop(); long elapsedMilliseconds = sw.ElapsedMilliseconds; // millisecond -> second int elapsedSecond = (int)(elapsedMilliseconds / 1000); } 감사합니다.
C#
2021. 12. 16. 11:04