All Questions
Tagged with milliseconds or time
31,525 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
75
views
How to detect or mitigate wall-clock time jumps when validating offline software licenses?
I’m implementing an offline license validation mechanism in a desktop/server application.
The license has an expiration date and must continue to work without any online checks.
The problem I’m facing ...
2
votes
1
answer
142
views
How to assign a std::string from std::put_time in C++?
I need to set the result from std::put_time from ctime into a std::string, how do I do this ?
Here is my code:
BBToolkit::LogManager::LogManager() {
auto t = std::time(nullptr);
auto tm = *std:...
Best practices
3
votes
4
replies
106
views
PostgreSQL: Should I store timestamps as UNIX epoch or timestamptz?
I'm dealing with a timezone issue in a PostgreSQL project and would like some advice.
I'm currently choosing between two ways to store timestamps:
1. UNIX timestamp (bigint)
Very safe in terms of ...
2
votes
1
answer
80
views
Storing store time of day ranges where timezone matters
I need to store some store hours that exist in different time zones and may be interacted with in different timezones through an admin portal where it will display store time and local time.
I know ...
Advice
0
votes
4
replies
162
views
Why is my O(nlogn) solution faster than the O(n) solution
here is my solution to the leetcode "longest consecutive sequence" problem:
class Solution:
def longestConsecutive(self, nums: List[int]) -> int:
if len(nums) == 0:
...
9
votes
2
answers
725
views
Using Chrono, how can I get millisecond precision?
C++, using <chrono>, I would like to get a value formatted as <seconds>.<milliseconds>. I am using system_clock and get the current seconds as:
auto secs = duration_cast<seconds&...
1
vote
1
answer
193
views
How can I create a `onClick` event for the timer in the events section?
The program I am using has a small section for programming which is almost similar to the Delphi programming language.
In the components section, there is no timer and I want to create it myself.
{$...
1
vote
1
answer
72
views
modpost GPL error using ktime_* - what to use instead?
I'm building a non-GPL kernel module (non-negotiable) and in order to get timing information everywhere I look here and elsewhere tells me to use the new ktime_* API, but when I build I get this error:...
0
votes
1
answer
135
views
Import timestamp from Rstudio to Snowflake changes timezone
I'm exporting some data from Snowflake to Rstudio and do some data processing. After that I write the data back to Snowflake. The problem is that somehow the timestamp initiale from Snowflake is ...
1
vote
1
answer
61
views
Identifying and summing time values across a row in Google Sheets
I am creating an activity tracker in Google Sheets:
In column B, I want to be able to track the total time doing activity ("Ac.") B. So I want to be able to sum the difference between (in ...
-3
votes
1
answer
69
views
Pause loop to make a certain action then continue where you left off inside of it
import pyautogui
import time
def RunD(Down, Up): #Up is the parameter that creates the delay
pyautogui.keyDown('d')
pyautogui.mouseDown(button='left')
time.sleep(Down)
pyautogui.keyUp('...
1
vote
3
answers
200
views
Reducing Latency in Pixel Scanning for Input Simulation
I am developing a Python script to pass a challenging minigame in a single-player title. My goal is to unlock a specific achievement within this game, a task I've spent over 10 hours attempting ...
0
votes
0
answers
65
views
What is the fastest way to compute a filter in Fourier space?
I am currently working on a beam propagation code. The code basically consists of a transversal profile (a 2000x2000 array) which is propagated a small distance, then has its borders filtered, then ...
0
votes
1
answer
66
views
How in python can I transform negative secs into struct time? [duplicate]
I'd like to transform -238204800 seconds to ".&checktime(1962,06,15,':') 00:00:00", using python 3.8.
My code is :
from time import strftime, localtime
secs = -238204800
print(strftime("%Y:%m:%d %H:%M:%...
0
votes
1
answer
193
views
Why can consecutive calls to perf_counter_ns on windows return the same number?
Using the below code, I would have assumed to see cnt be close to 0, but on Windows I see only values above 500,000.
from time import *
def test_time(f, c):
cnt = 0
for i in range(c):
...