3,210 questions
2
votes
3
answers
172
views
How to pipe a data file with multiples read values to a bash script with a delay between them? It is possible to display the info read from file
This is my main script:
#!/bin/bash
read -p "Name: " NAME
read -p "Age: " AGE
read -p "Country: " COUNTRY
echo "Your name is $NAME. You are $AGE years old. You ...
0
votes
1
answer
238
views
Java and Java Swing - Can someone explain these Thread.sleep() interactions?
I'm working on my first personal project - making a simple game of blackjack with Java and Java Swing (just what my class is going over) and I want to make it so that when a card is drawn in ...
7
votes
1
answer
87
views
Light sleep wakeup via UART
I want to wake up the ESP when it receives a message on the UART2 port. However, with the following code it never wakes up, even if a message is received. I am using the Lolin 32 Lite Devboard.
#...
2
votes
1
answer
115
views
When using asyncio, how can I throttle the rate of a dependent sequence of web requests without blocking responses to these requests?
I am attempting to send out a grid, or lattice, or "matrix" of API requests using asyncio: For a "category 1," I may wish to request the datasets 1a, 1b, 1c. For category 2, I ...
0
votes
0
answers
23
views
how windows UMD/app know when to exit modern standby
I want to develop a UMD (user mode driver) on windows, when UMD will notify apps when windows exited from modern standby.
So, I want to know how a UMD know when windows exit modern standby?
I find ...
1
vote
0
answers
53
views
How to connect a Python program to an external clock to achieve microsecond precision?
So, in my program I am trying to achieve microsecond precision, not only for counting purposes but also delays and sleep functions.
I have tried all the functions like time.time or time....
3
votes
1
answer
176
views
Why does putting a thread to sleep cause cache performance issues?
I was having strange performance issues in a single-threaded real-time program which I eventually narrowed down to this minimal example. It takes an array of 1 million floats as inputs, does some ...
0
votes
1
answer
83
views
Is there a way to automatically wake a WinAPI GetMessage() after n seconds?
As explained here, the Windows API GetMessage() blocks until a message is available.
I would like to automatically wake after n seconds. Alternatively, I'd like to have the system post a WM after n ...
-3
votes
1
answer
147
views
How can I ensure that a Message Loop in Win API doesn't use the CPU when no messages available?
How can I ensure that a Message Loop in Win API doesn't use the CPU when no messages are available? In other words, I effectively want a Message Loop which says "Sleep until I have a new message&...
2
votes
0
answers
58
views
Different results of sleeping with libfaketime in Linux [duplicate]
I am working on an embedded Linux system (kernel-5.10.24), and I am testing libfaketime in the system.
I got the master of libfaketime, after built it, I ran my test in shell as follows.
with sleep 4 ...
0
votes
0
answers
87
views
How does sys.getswitchinterval() work with PyQt?
From the docs:
setswitchinterval
Set the interpreter’s thread switch interval (in seconds). This
floating-point value determines the ideal duration of the “timeslices”
allocated to concurrently ...
2
votes
1
answer
220
views
Why can I not wait for 10^12 picoseconds using std::chrono and long long as a representation?
The following code fails to wait for picoseconds_longlong(1'000'000'000'000). Why?
#include <chrono>
#include <iostream>
#include <thread>
using namespace std;
using ...
1
vote
0
answers
62
views
PIC18F25K80 Sleep Mode
I've been working on a project with PIC18F25K80 MCU for a while. My main purpose is to collect some sensor data based on user-defined intervals(like 1min) and since this is a battery-powered ...
0
votes
1
answer
281
views
ESP32C6 Deep Sleep Recovery via External IO
I'm finding it difficult to find much reliable information on how to implement deep sleep in combination with wake on external IO with ESP32C6 (ESP32-C6-DevKitC-1, rev. 1.12). After days of false ...
0
votes
0
answers
60
views
Is it possible to sleep in a JSF application run under WL 12.2?
Technical info: JSF application (2.0) that is deployed as an EAR on a WL 12.2 machine.
Problem: The users of our web application regularly upload DOCX files. But this file type is not allowed for ...
1
vote
2
answers
251
views
Sleeping for a random amount of time in a stored procedure
A vendor application we're using utilizes multiple processes (not threads) spread across multiple computers, one for each processing core available. When asked for a batch of calculations, the ...
0
votes
0
answers
55
views
Why Android KeyStore fails to setKeyEntry in deep sleep mode? (Bouncy Castle)
I have an Android Service for reading messages which is always enabled in my App. Sometimes connection to the Messages Broker is gettings lost and it call special event for recconecting.
Log.d(TAG, &...
2
votes
2
answers
95
views
How do I wait on an IBM PCjr?
I'm having trouble with a program I am trying to write for my PCjr, where I need to pause the program for an amount of time before running the next instruction. Here it is:
10 CLS
20 PRINT "|&...
1
vote
1
answer
85
views
Is it possible to make just a part of code wait?
I want to have a delay in my code, but I dont want to delay all of my code, just this part. Is it possible to do that? Modules like time or os etc. only have option to delay all the code after using ...
2
votes
2
answers
2k
views
iOS Swift Task.sleep accuracy
I was looking into a cancellable async delay in Swift which is backwards compatible to iOS 15:
Task {
let before = Date.timeIntervalSinceReferenceDate
let seconds: TimeInterval = 100
...
0
votes
1
answer
192
views
How to make a recurring timer publish changes to the main thread Swift?
I am wanting a check to be done every 5 mins. For this to happen there obviously needs to be a timer of some description running in the background.
I have a timer func which calls a working func where ...
3
votes
1
answer
80
views
How to introduce a lag (sleep) in rowwise mutate
I need to make a call to an API separately for each row of my tibble. How can I introduce a small lag between each call? I need to do this because the API I am using limits the allowable number of ...
0
votes
0
answers
53
views
How to prevent my spec suite to be super-slow?
On one of my project, the CI is super-slow, even so slow that we can't run some specs on all machines or it takes hours. Yes, hours.
It shouldn't take that long, that's for sure, because those specs ...
4
votes
1
answer
80
views
setTimeout() not available in mujs
Help, I'm trying to setup my environment to do a Hello World.
1 #!/usr/bin/env mujs
2 ...
0
votes
0
answers
44
views
What will happen to the process attempting to go to sleep.when an interrupt occur?
chapter- 6, desin of unix operating system book (question-16).
Suppose a process attempts to go to sleep on event A but has not yet executed the code in the sleep algorithm to block interrupts; ...
0
votes
1
answer
321
views
About the sleep function implementation in xv6
I am taking the os course for mit6.s081, but I seem to misunderstand some concepts in sleep&wakeup. My problem is that after scheduling occurs in sched() in sleep(), p->chan = 0 does not seem ...
0
votes
0
answers
51
views
Python debugging in VSC: Cannot see Call Stack during time.sleep()
I am debugging python in MS Visual Studio Code and stepping through the code with F11.
When I get to a timer sleep() method, during the "sleep period" the Call Stack goes blank and I have no ...
0
votes
1
answer
48
views
JavaScript. Selenium. Implicit wait and driver.sleep won't work together
I have suck script for Twitter login automation. I've set waits on 21 line and I script to wait on 34 line. But driver.sleep on line 34 doesn't work
'use strict';
const {Browser,Builder, By, Key} = ...
0
votes
2
answers
102
views
Bash child scripts - Timer interuptable by signals - read, timeout and sleep doesn't work
So, I'm on Arch Linux, running i3
I have a slideshow script that changes the background every 5 seconds. And I have a bunch of signals, such as toggle, next, previous, faster, slower. I have all of ...
1
vote
0
answers
47
views
Sleep in Java behaving weirdly, with GUI, not running GUI commands till end
This is my first time working with threads so I apologize if the answer to this is simple. I have a GUI and when the user clicks a button, I want it to update the text to display the fact that a task ...
-1
votes
1
answer
166
views
Windows cmd timeout command not continue
I'm trying to run multiple commands in Windows cmd. And need to sleep for ~4 seconds between the commands.
I copy my commands block to the cmd and then want them to run one after the other with breaks ...
0
votes
1
answer
177
views
How do I use the `Sleep()` procedure in TMS WEB Core?
Normally in VCL and FMX, you can use Sleep() to pause execution of code. So something like this as an example:
while true do
begin
// Do some code
Sleep(50);
end;
So after every iteration, it ...
0
votes
1
answer
687
views
How can sleep be achieved in Gleam?
I need to suspend a thread (or process) for a specific duration. In other languages, like Python or JavaScript, this can be achieved using time.sleep() or setTimeout(), respectively.
What is the ...
3
votes
1
answer
141
views
Wait for n amount of milliseconds to continue executing the code in V
I am building a web crawler in V to index some URLs. The problem:
I need to limit the amount of requests I send every second, and let’s say I want to send a request every two seconds.
I've used many ...
1
vote
0
answers
57
views
Sleep() function. seems to interfere with \b and \r command
C++ beginner here, so please excuse me if this is caused by something simple I'm overlooking.
I was learning how to use the \b and \r commands. In my test program, they seem to run just fine, but when ...
0
votes
0
answers
47
views
line of program before sleep not run [duplicate]
from PyQt5.QtWidgets import *
from PyQt5 import QtCore
from PyQt5 import QtGui
import sys
import time
class Window(QMainWindow):
def __init__(self):
super(Window, self).__init__()
...
0
votes
0
answers
1k
views
oidc-client-ts stops calling automatic silent renewal of a token when the computer goes into sleep mode and the session idle time is out
I am using react-oidc-context with oidc-client-ts for keycloak authentication.
Oidc-client-ts provides automaticSilentRenew setting, and it's working fine when the tab is inactive or active. I always ...
-1
votes
1
answer
53
views
How acurate is a Golang time.Sleep() on a Google Cloud Pod when the amount is subseconds?
I added a loop which tries to read data from a database and if not yet available, sleeps for 250ms and try again. It works, as in, it will eventually retrieve the data, but the time it takes to do so ...
-3
votes
3
answers
233
views
Top level sleep function for Javascript [duplicate]
I need a sleep function for my Js code. I can use a promise based function but that needs await keyword to work. But the problem is I need to use the sleep function at the top level.
function sleep(...
1
vote
1
answer
121
views
Why is the output of an async function printed before that function is called?
The behavior of async functions is different even though they are almost the same code, but I don't understand why.
My code is:
import asyncio
async def func1():
await asyncio.sleep(1)
print(&...
0
votes
0
answers
496
views
ESP32 C3 not consistently Waking up from Deep Sleep
i need some help figuring out my mistake.
I have a custom Esp32 C3 Board which is powered by a 18650 Battery and has a charging and battery protection circuit. The esp is supposed to go to deep sleep ...
1
vote
1
answer
97
views
How can I make a program run for a given amount of time on the CPU in C++?
"I want to write a program that consumes 5 seconds of CPU time, where the time spent off the CPU due to IO, context switches, etc., is not counted towards this 5-second time quota.
Currently, I'...
1
vote
1
answer
17
views
is there a better option to work with other than time.sleep() in tkinter GUI
Guys everytime I use time.sleep() my program misbehaves and I needed to delay my program for a few seconds before proceeding what can I do
I imported time and my program started to hang I cant even ...
0
votes
1
answer
50
views
Python printing after a while loop, involving sleep statements
I have this function I wrote to do a simple type of half-way search for an integer, as a practice problem. When I run it, I would expect these print statements to be firing after each while loop, ...
1
vote
0
answers
420
views
C++ std::this_thread::sleep_for() sleeping longer than expected for small durations
I'm encountering an issue with std::this_thread::sleep_for() in my C++ application. I'm using it to pause the main thread for a small duration to adjust my frame_rate, but I've noticed that when [...
0
votes
1
answer
56
views
UDP Streaming in Python: Unexplained Delays Beyond Sleep Time
**I'm working on a school project involving UDP streaming in Python, where a client (udp_stream.py) sends messages to a server (udp_stream_server.py). The client script is designed to send a specified ...
-1
votes
2
answers
203
views
why does it say that "sleep(1)" is undefined? [duplicate]
here's the error i got
#ifdef _WIN32
#include <windows.h>
#endif
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
srand((unsigned)time(NULL));
int ...
-2
votes
2
answers
126
views
How to wait for async task to finish getting data from database before loading maps without sleep?
So my object is simple and need to know if I can either make my code better all the way around or remove sleep from my code and somehow wait for the async task to finish with getting data from a ...
1
vote
0
answers
645
views
Run background task in Google Colab
I writing some scripts in Google Colab. I am not using Google Colab pro - just the basic version.
Part of the flow requires me to execute a binary command (i.e. bash command) - to set something ...
0
votes
1
answer
84
views
Does the sleep method work insied a dramatiq actor?
If I made a function as a dramatiq actor and put it to sleep for 10 minutes before performing certain tasks,does it wait for the sleep to be completed before performing those tasks or does it ...