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.
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 .
IClock
Or do you just mean Thread.Sleep?
Thread.Sleep
, , , , . ( ), .
, , , Windows "PauseTime", , , . .
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.
System.Diagnotics.Stopwatch
Hope this helps!
Source: https://habr.com/ru/post/1758191/More articles:Using PagedCollectionView for four ListBoxes that support drag and drop = Index Errors When Applying a Filter - silverlighthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1758187/any-example-for-security-of-net-desktop-application&usg=ALkJrhjatbTVE8SAL_2XVBgusMky1NolDwI get a warning: incompatible Objective-C types assigning 'struct NSString *', expected 'struct NSMutableString *' - iphoneShould I specify the installer or not? - oopPYTHONPATH storage location - pythonОбтекание однострочного div вокруг img (не текста) - htmlC ++ read / write XML without CLR - xmlHow to use web.xml or call servlet init () when using GWTTestCase - unit-testingHow can I refresh a JS script page for everyone who views it? - javascriptRecursively remove file name suffix from files in shell - unixAll Articles