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