время

Python. How do I make a delay without freezing the program?

When using time. sleep(x), the entire program stops. I also make a bot in which you need to wait after each action. You can't ... ops the ENTIRE program, and after each operation, no one can use the bot. How do I make a delay without freezing the program?

Python how many days,minutes,seconds left from date to date

I have two dates: current and new year's. It is clear that using the datetime module in Python 3 , you can subtract these da ... of time until the new year in seconds, days, minutes, hours, etc. Example: До нового года: 60 дней 22 часа 45 мин 12 сек.

Why is a long int used for storing time, and not an unsigned long int?

If I'm not mistaken, the problem of 2038 concerns only those programs that used 32-bit long int to work with time. But why di ... rking with an unsigned type, this would be the problem of 2106. On Wikipedia there is a corresponding gif for the sign type:

Why does the C/C++ time() function take an argument?

As I read on cppstudio, the function time(), when passing an argument that is not equal to NULL, returns the same value that ... time. Convince me that it is useless to pass it an argument other than NULL (you can simply dereference the pointer with *).

How to translate milliseconds into normal time for understanding

I write a small player using QMediaPlayer. There is a signal that is triggered every 1000 milliseconds. I'm wondering, is it ... time like 2:23 (2 minutes twenty-three seconds), or do I need to make 2 widgets; one for minutes and the second for seconds?

Get the date and time in unix time

There is a date and time, for example 08.06.2013 15:40. How can I get the unix time of this date using PHP?

Python 3 Time Counting

The user enters the number of hours and minutes. All combinations are possible, i.e. it will enter only hours or only minutes ... hour = minute // a ps2_state.config(text=f"Оставшееся время: {minute} минут") second = second - 1 time.sleep(1)

Output the date in the desired format (abbreviation)?

There is already a date in the format 2012-05-05 00:00:00 How can I shorten it, leaving only the date, and remove the hours, ... es, and seconds? Of course, you can explode, but maybe there is something more efficient, for example, through the same date?

Split the time in milliseconds into days/hours/minutes

There is a time long lasttime = getLastLogin(user); Subtract from the current time (System.currentTimeMillis()) the time la ... )-lp) / 1000 / 60L);//min :: int eh = (int)((em*60)-(int)(em/60));//hour :: int ed = (int)((em*60*24)-(int)(em/60/24));//day

The rand function in the loop

double rnd() { srand(time(0)); return(rand() % 1000 / 1000.0); } I call the function above in a loop, you need to m ... t a bunch of identical numbers. To solve my problem, I need to get a random number on each scroll (probability) some event.

How do I compare a given time with the current one? js

I'm making a movie theater website. There is such a function that when you click on a certain button, it draws the desired h ... backgroundColor = '#3296C1'; selectedHall.classList.remove('displayNone'); } } } drawSelectedHall();

How can I replace scala. concurrent. duration.FiniteDuration in Java?

How can I replace scala. concurrent. duration. FiniteDuration in Java? For this class, we only use the toSeconds () method, i ... ration. FiniteDuration, but it is necessary to abandon the dependencies on scala. So I'm looking for an alternative in Java.

How to determine the time zone of the user who visited the site?

The site has news with an indication of the time when they were published. The time is specified in Moscow, for example, 12: ... what is the best way to display the time if the person came from a different time zone? Can add a postscript "Moscow time"?

How to find the time difference in C?

Formed the time t1,t2 by mktime. Now we need to find the difference. For some reason, my watch is 6 hours longer. What to do?

How to reduce the execution time from 1 second to at least 100 ms in the lightest algorithm?

I decided to write a simple program for training and practice. The solution is correct, but very slow. I pass a task on the s ... Oxmain++; } Oxmain = 1; Oymain++; } cout << l << endl; }

Convert seconds to an easy-to-read format

There is a certain number of seconds of the video duration, you need to translate them into the form "hour: min:sec". var mi ... wN.slice(newN.indexOf('.')+1) right = (right > 59) ? '59' : right var result = left +':'+ right Is there a better code?

Get the world time via the api using JS (API request)

How can I get the time of a non-computer user via let time = new Date().getTime(); Without using other programming langua ... rks. And to get the time via the API, without relying on either the server time or the time installed on the user's computer?

Creating a list of hours in days in 15-minute increments

You need to create a list of hours in days in 15-minute increments. Like this: time = ['00:00', '00:15', '00:30', '00:45', ' ... tr(hour), str(min)) if string == "24:15": break time.append("{}:{}".format(str(hour), str(min)))

How to convert clock t to int

How to convert clock_t to int? I need to do this with precision to the system ticks.