Questions tagged [delay]

Delay refers to amount of time between two events.

A delay is simply the difference in time between two events.

This may refer to the start and stop of a single event (e.g. data processing delay) or the execution of two separate, independent events.

A delay may be manually implemented by the programmer using sleep or pause functions common in many programming languages.

In the case of computer networks, delay between sending and receiving of data packets is referred to synonymously as latency.

4215 questions
19
votes
1 answer

How long pauses can occur in a Haskell program due to garbage collection?

Relating to my other question Haskell collections with guaranteed worst-case bounds for every single operation?, I'm curious: How long pauses can be caused by garbage collection? Does Haskell use some kind of incremental garbage collection so that a…
Petr
  • 62,528
  • 13
  • 153
  • 317
18
votes
1 answer

Python, parallelization with joblib: Delayed with multiple arguments

I am using something similar to the following to parallelize a for loop over two matrices from joblib import Parallel, delayed import numpy def processInput(i,j): for k in range(len(i)): i[k] = 1 for t in range(len(b)): j[t]…
Francesco
  • 393
  • 1
  • 3
  • 8
18
votes
2 answers

How can I get millisecond and microsecond-resolution timestamps in Python?

How do I get millisecond and microsecond-resolution timestamps in Python? I'd also like the Arduino-like delay() (which delays in milliseconds) and delayMicroseconds() functions. I read other answers before asking this question, but they rely on the…
Gabriel Staples
  • 36,492
  • 15
  • 194
  • 265
17
votes
1 answer

How to sleep or delay the thread in Haskell?

This really shouldn't be so difficult to find an answer to, but alas I don't... I want to delay the next execution step in a do block. I have found the functions delay, sleep, nanosleep and usleep. And also this question, that doesn't cover how to…
lo tolmencre
  • 3,804
  • 3
  • 30
  • 60
17
votes
2 answers

How to delay jquery animation?

I can't seem to delay the showing of a div. I want to delay the animation by about 20 seconds is this possible??? $("#microcharcounter").delay(10000).show();
user342391
  • 7,569
  • 23
  • 66
  • 88
17
votes
16 answers

Is there an alternative for sleep() in C?

In traditional embedded programming, we will give a delay function like so: for(i=0;i<255;i++) for(j=0;j<255;j++); In the microprocessor's view, is this how the sleep() function works? Is there an alternative for the sleep() function in C?
Manoj Doubts
  • 13,579
  • 15
  • 42
  • 45
17
votes
4 answers

Wait for n seconds, then next line of code without freezing form

Hi I am trying to find a method of waiting a number of milliseconds before moving to the next line of code, I have looked into Thread.Sleep but this will freeze the main form, I would like this to remain active. I tried timers and stopwatches and…
Someone
  • 894
  • 3
  • 22
  • 43
17
votes
3 answers

Why is there a delay when moving object using UIPanGestureRecognizer?

I'm moving UIView object using UIPanGestureRecognizer — how much I drag my finger on screen, that much I move the view in the same direction (only in X - left or right, Y is not changing). It works fine, but with (very noticeable) delay. Here is the…
16
votes
6 answers

Add a delay to Progress Dialog

I want to make a dummy progress dialog appear for 2 or 3 seconds. It won't actually do anything other than say detecting. I have the code: ProgressDialog dialog = ProgressDialog.show(this, "", "Detecting...", true); …
Sapp
  • 1,793
  • 7
  • 29
  • 51
16
votes
7 answers

Delays between promises in promise chain

Let's say I am using the following code to run a couple of promises in series: let paramerterArr = ['a','b','c','d','e','f'] parameterArr.reduce(function(promise, item) { return promise.then(function(result) { return mySpecialFunction(item); …
Forivin
  • 14,780
  • 27
  • 106
  • 199
16
votes
3 answers

OpenCV Python Video playback - How to set the right delay for cv2.waitKey()

I used the following code to capture a video file, flip it and save it. #To save a Video File import numpy as np import cv2 cap = cv2.VideoCapture(0) # Define the codec and create VideoWriter object fourcc = cv2.cv.CV_FOURCC(*'XVID') out =…
Clive
  • 1,137
  • 7
  • 19
  • 28
16
votes
4 answers

Android Sleep/Wait/Delay function

first of all, I'm a beginner to android world so please apologize me if it is stupid question.. I'm trying to do following: Enable Mobile Data Wait for 10 seconds a. check if Mobile got IP address (data connected sucessfully) b. if Not…
ShitalSavekar
  • 379
  • 2
  • 4
  • 10
15
votes
3 answers

Can the execution of statements in Python be delayed?

I want it to run the first line print 1 then wait 1 second to run the second command print 2, etc. Pseudo-code: print 1 wait(1 seconds) print 2 wait(0.45 seconds) print 3 wait(3 seconds) print 4
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
15
votes
5 answers

How Can I Open a WPF Popup with a Delay?

I simply want to open up the WPF Popup with a delay, sort of like a ToolTip. How can I achieve this? And, by the way, Popup.PopupAnimation = PopupAnimation.Fade ... fades in too quickly. I want at least half a second in there.
cplotts
  • 13,941
  • 9
  • 55
  • 66
15
votes
7 answers

Eclipse (Galileo) : Why does "Initializing Java Tooling : 59%" take FOREVER?

New to Java and Eclipse. For some reason, the first time I load Eclipse on a given day, it freezes at "Initializing Java Tooling : 59%". Eventually, it gets past this and I can do my work. However, this "Initializing Java Tooling : 59%" stage…
sangfroid
  • 3,733
  • 11
  • 38
  • 42