일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- ListView
- windows10
- string
- Binding
- Github
- Visual Studio
- git
- algorithm
- 코딩테스트
- coding-test
- dotNET
- convert
- commit
- log
- Microsoft
- csharp
- Coding
- programmers
- logging
- .net
- WPF
- nullable
- Process
- tls
- IValueConverter
- chashtag
- mysql
- File
- windows
- C#
Archives
- Today
- Total
목록stopwatch (1)
CHashtag

안녕하세요. 오늘은 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