Questions tagged [pausing-execution]
61 questions
357
votes
12 answers
Proper way to wait for one function to finish before continuing?
I have two JS functions. One calls the other. Within the calling function, I'd like to call the other, wait for that function to finish, then continue on. So, for example/pseudo code:
function firstFunction(){
for(i=0;i

DA.
- 39,848
- 49
- 150
- 213
14
votes
3 answers
JavaScript pausing execution of function to wait for user input
I'm trying to make a sort of game using the HTML5 canvas, JavaScript and XML.
The idea is that you can make a quiz by putting questions and answers in an XML file.
I wrote a main loop that loops through all the questions, poses them and checks the…

Jort
- 1,401
- 8
- 23
- 39
11
votes
1 answer
R: Offer 5 seconds to demand a pause. If no pause demanded, resume the process
How can I offer 5 seconds to the user to write something in order to ask for a pause of indefinite length. If the pause is not demanded within these 5 seconds, the process continues. If a pause is demanded, then the user has all the time (s)he needs…

Remi.b
- 17,389
- 28
- 87
- 168
8
votes
4 answers
Can you pause MATLAB?
In MATLAB, I'm running some code which takes a while to run. I'd like to pause the code to check on some variable values. Is there a way I can do this without having to re-run the code from the beginning? I don't want to terminate the program; just…

Shen
- 164
- 1
- 1
- 7
7
votes
4 answers
how do I pause and resume a timer?
I got this function that starts a timer on this format 00:00:00 whenever I click on a button. But I don't know how to do functions resume and pause. I've found some snippets that I thought could be helpful but I couldn't make those work. I'm new to…

esandrkwn
- 399
- 1
- 6
- 18
6
votes
1 answer
A pattern for pausing threads similar to the CancellationTokenSource and CancellationToken pattern?
I started using the cooperative thread cancellation pattern provided in framework 4.0 by ConcellationTokenSource and CancellationToken and I found it very useful and simple.
My purpose is now to provide to my application a similar elegant and simple…

Mauro Ganswer
- 1,379
- 1
- 19
- 33
6
votes
3 answers
javascript nested loops waiting for user input
I built a C interpreter in C# a while ago and have now begun converting it to Javascript. Everything was going fine until I realized js has no sleep function. My interpreter uses a recursive parser and it pauses for user input while it is nested…

user2153050
- 103
- 1
- 7
6
votes
1 answer
Firefox resets animation on hover
I've put together a pure css text slideshow using a keyframe animation based on this code: https://codepen.io/johnlouie04/pen/BqyGb
I've made it so that when you hover the transition it pauses. This works perfectly in Google Chrome and Safari, but…

nicedayz
- 61
- 1
4
votes
3 answers
Is there a way to pause like system("pause")?
I've been looking for this on the internet for soooooo long. Is there a way you can press any key and it immediately stops the pause and carries on with executing the code but it doesn't show up the key you pressed on the screen (like…

SomeRandomGuy
- 111
- 1
- 8
4
votes
1 answer
How do I "pause" Server Sent Events?
How I pause a Server Sent Event connection? Is it even possible, or do I have to close the SSE and then reopen it and assign all of the event handlers again?
For example I would like to do (this is all theoretical, I do not know the pause/restart…

Naftali
- 144,921
- 39
- 244
- 303
3
votes
6 answers
How to pause a python script running in terminal
I have a web crawling python script running in terminal for several hours, which is continuously populating my database. It has several nested for loops. For some reasons I need to restart my computer and continue my script from exactly the place…

jerrymouse
- 16,964
- 16
- 76
- 97
3
votes
0 answers
Pausing and resuming script execution with key press (python)
I have a script that controls an external machine with rather slow i/o operations. I'd like to be able to suspend and resume execution by pressing a key at any time, in such a way that execution of the current iteration in the loop is first…

mishamtrope
- 45
- 3
3
votes
3 answers
Pausing a game and displaying a menu in SpriteKit
I'd like to implement a pause menu to my SpriteKit game and I always come across the code
self.scene.view.paused == YES
however it pauses everything inside the game, even the touchesBegan method. So when I display a menu before I pause the game, I…

user3545063
- 681
- 8
- 17
3
votes
1 answer
How does TSTP (polite pause) interact with my C++ program in linux?
I have written a C++ program and I am executing in the gnome terminal (I am on Ubuntu). I press Ctrl + Z, which suspends the process. Later on, I execute % on the same terminal, which resumes execution.
From what I've read, Ctrl+Z sends a TSTP…

a06e
- 18,594
- 33
- 93
- 169
2
votes
4 answers
How to pause a function in javascript until a CONDITION is met, not until a defined limit in millisecond is set!
this is urgent and i couldn't find a solution to it. The problem is as follow:
i am designing a web app, which sends multiple commands to multiple machines. Now some of the commands i have require additional input. i have designed a pop up window in…

ccot
- 1,875
- 3
- 36
- 54