Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取代码执行时间(精确到毫秒) #51

Open
topcss opened this issue Oct 31, 2019 · 0 comments
Open

获取代码执行时间(精确到毫秒) #51

topcss opened this issue Oct 31, 2019 · 0 comments
Labels

Comments

@topcss
Copy link
Owner

topcss commented Oct 31, 2019

private void Time(int i)
{
   Stopwatch sw = new Stopwatch();
   sw.Start();
   Thread.Sleep(i);
   sw.Stop();
   Console.WriteLine(sw.ElapsedTicks / (decimal)Stopwatch.Frequency * 1000);
}

ref: https://www.cnblogs.com/Rainm/p/10551074.html

@topcss topcss added the 🔪C# label Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant