I need to run a cycle for a certain duration. For example, the code I'm trying to do will look like this:
initialize and lauch timer while timer<10000sec: do things
Do you know how to do this?
Thanks:)
stop = time.time()+10000 while time.time() < stop: do things
This requires that each run through the cycle be short enough so that you read the current time often enough (to ensure the accuracy you want to achieve).
Source: https://habr.com/ru/post/1333654/More articles:How to copy as admin in windows7 - javaPossible reasons for Directory.CreateDirectory throwing an UnauthorizedAccessException on a shared host - securityWhich IDE is best for developing an iPhone? - eclipseLua, XML, UTF-8 - xmlhow to change json key: value - jsonProcessing Expires Headers in ASP.Net MVC - asp.netSocket Programming - socketshow many nodes can a binary tree have at level n? Use induction to prove the answer - data-structuresHow to get an IP address in C #? - c #How to improve tesseract number recognition results - iphoneAll Articles