Windows Pause Time

I'm trying to pause using C # /. NET I can set the time, but I would like to set the time for a pause.

Does anyone know how to do this?

Command line suggestions will also be helpful.

I am using Visual Studio 2010 if that matters.

+3
source share
4 answers

For testing? or real life?

For testing, you can mock DateTime.Now (although it is easier to have an interface IClock). For real use - I'm just not .

Or do you just mean Thread.Sleep?

+3
source

, , , , . ( ), .

0

, , , Windows "PauseTime", , , . .

0

If you need to figure out the elapsed time for some debugging work, there is a class System.Diagnotics.Stopwatch. The MSDN page has some good examples of how to use it. I don’t know what type of accuracy you are looking for, so this may not be the class you need if you are looking for highly efficient time diagnostics.

Hope this helps!

0
source

Source: https://habr.com/ru/post/1758191/


All Articles