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
7
votes
4 answers

Time delay on click

Can anyone send me JavaScript code on how I can construct a time delay from the time I click a button on a page to the time the function called by the button click is executed. I am a novice with JavaScript, and I have some code that performs a…
aammaguiar
7
votes
3 answers

Set a delay in ajax call

I am trying to add a small delay (2 sec) between the loader icon and the success with the data as html. What I have tried to use is the setTimeout and put in a delay number. This is not working, so I was hoping you could show me what the correct way…
Mikkel
  • 1,771
  • 11
  • 35
  • 59
7
votes
1 answer

Raspberry Pi program delay

I use Raspberry Pi to display web page automatically at startup. The issue is : As soon as the raspberry is started, Midori is launched, but I've the message "Cannot Resolve Hostname....". When I update the webpage 30 seconds after startup, it is…
gloops100
  • 159
  • 2
  • 2
  • 11
7
votes
1 answer

C#/.NET 4.5 - Why does "await Task.WhenAny" never return when provided with a Task.Delay in a WPF application's UI thread?

Given the following code, why does ask.WhenAny never return when provided with a Task.Delay of 1 second? Technically I'm not sure if it does return after a extended amount of time, but it doesn't after 15 seconds or so after which I manually kill…
Matt
  • 774
  • 1
  • 10
  • 28
7
votes
3 answers

Call Thread.Sleep from the Task

Is it correct to use Thread.Sleep() inside the task. Or is only a timer (Task.Delay() in .Net 4.5 and latter) used with task? Or maybe another approaches exist.
SerG
  • 1,251
  • 4
  • 18
  • 37
7
votes
1 answer

MSMQ messages always arrive delayed by exactly 3 minutes on the same machine

I'm facing an extremely puzzling problem. I have a Windows service that monitors two MSMQ queues for input and sends messages to another MSMQ queue. Although the send operation seems instant from the service's perspective it actually takes the…
Alex G.
  • 2,113
  • 6
  • 25
  • 33
7
votes
6 answers

Add a class using jQuery after a delay

When an element is clicked, I want to add a class to the body element, but with a slight delay. So, element1 is clicked, then after .5 seconds, the body is a given a new class. I was using this which works to an…
user2586455
  • 591
  • 2
  • 7
  • 16
7
votes
2 answers

Delay with hoverintent

var config = { sensitivity: 3, interval: 5000, timeout: 5000, }; $("#cart-summary").hoverIntent(function () { $('.flycart').slideDown('fast'); }, function() { …
eozzy
  • 66,048
  • 104
  • 272
  • 428
7
votes
1 answer

Delaying a click event with .delay()

I have a button that gets triggered by the click of another button. I want to delay click of the second button for two seconds. I used .delay() but it didn't work. jq(function() { jq('a.box').click(function() { …
Talha
  • 350
  • 1
  • 4
  • 19
7
votes
3 answers

CAKeyFrameAnimation delays before repeating

I have an ball image that I'm animating around a path. The animation is set to repeat forever, but why is there a delay between repeats? Here's my code: CGPathRef aPath; aPath = CGPathCreateWithEllipseInRect(CGRectMake(0, 0, SIZE, SIZE),…
Kelly Bennett
  • 725
  • 5
  • 27
7
votes
3 answers

How do timers and delays work on low level

I cannot really find anything interesting concerning this question, but I've been wondering for quite some time now how timers and delays in any programming language work at low level. As far as I understand, a CPU continuously executes instructions…
MarioDS
  • 12,895
  • 15
  • 65
  • 121
7
votes
1 answer

Twitter Bootstrap Popup ignores delay

Following this question here on stackoverflow, I created a twitter bootstrap popover that loads on hover. However, the delay is not used, the popover just shows immediately. Here's my code: $('body').delegate('.withajaxpopover', 'hover',…
HombreFab
  • 223
  • 1
  • 4
  • 7
6
votes
4 answers

Delay execution 1 second

So I am trying to program a simple tick-based game. I write in C++ on a linux machine. The code below illustrates what I'm trying to accomplish. for (unsigned int i = 0; i < 40; ++i) { functioncall(); sleep(1000); // wait 1 second for the…
raze
  • 662
  • 3
  • 8
  • 25
6
votes
3 answers

How to repeat (loop) Jquery fadein - fadeout - fadein

I am struggling with my first jQuery script. I've got a DIV on my page that is set to hide via CSS. Then, I have this script that runs to make it fade in, fade out, then fade in again: