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

Delay automatic url redirect with jquery?

I need a transition page that will display for 2 seconds before automatically redirecting to the home page. How do I do this? I can't seem to get delay to work for me.
mark
  • 353
  • 1
  • 3
  • 4
35
votes
5 answers

How can I perform a short delay in C# without using sleep?

I'm incredibly new to programming, and I've been learning well enough so far, I think, but I still can't get a grasp around the idea of making a delay the way I want. What I'm working on is a sort of test "game" thingy using a Windows forms…
user2706003
  • 361
  • 1
  • 3
  • 4
34
votes
17 answers

implement time delay in c

I don't know exactly how to word a search for this.. so I haven't had any luck finding anything.. :S I need to implement a time delay in C. for example I want to do some stuff, then wait say 1 minute, then continue on doing stuff. Did that make…
developer
  • 7,252
  • 14
  • 49
  • 57
34
votes
4 answers

Delay Actions in Swift

I want to make an Activity Indicator start animating and then stop after one second. So does anyone know how I could do that? class stuff { @IBOutlet weak var indicator: UIActivityIndicatorView! func iGotTriggeredBySomething { …
user4001326
33
votes
7 answers

Xcode Objective-C | iOS: delay function / NSTimer help?

So I'm developing my first iOS application and I need help.. Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just want the first button to highlight for 60 milliseconds, unhighlight, second button…
Retro
  • 333
  • 1
  • 3
  • 5
33
votes
3 answers

Idiomatic jQuery delayed event (only after a short pause in typing)? (aka timewatch/typewatch/keywatch)

Here is some jQuery for a search box that I expect is actually an antipattern, and am sure there is a much better solution for that I would love to be pointed towards: I will describe it in comments then just give the code, since the comments may be…
Kzqai
  • 22,588
  • 25
  • 105
  • 137
31
votes
8 answers

Add a delay after executing each iteration with forEach loop

Is there an easy way to slow down the iteration in a forEach (with plain javascript)? For example: var items = document.querySelector('.item'); items.forEach(function(el) { // do stuff with el and pause before the next el; });
Kirk Ross
  • 6,413
  • 13
  • 61
  • 104
31
votes
5 answers

delaying actions between keypress in jQuery

How can I delay actions between keypress in jQuery. For example; I have something like this if($(this).val().length > 1){ $.post("stuff.php", {nStr: "" + $(this).val() + ""}, function(data){ if(data.length > 0) { …
Sinan
  • 5,819
  • 11
  • 39
  • 66
29
votes
6 answers

display data after every 10 seconds in Android

I have to display some data after every 10 seconds. Can anyone tell me how to do that?
Farha Ansari
  • 5,855
  • 5
  • 26
  • 22
28
votes
4 answers

OnKeyUp JavaScript Time Delay?

Hi Again Masters Of The Web :) Now, I have got a new stupid question, and I am asking to forgive me. I read everywhere about this solution, but didn't find the one that works for me. I have got:
Spoonk
  • 705
  • 2
  • 10
  • 17
27
votes
6 answers

Javascript sleep/delay/wait function

Sorry if this question has already been asked here before, I could not find a suitable answer. I am wanting to create a JavaScript sleep/delay/wait function that I can call anywhere in the script, like jQuery's .delay() I am not able to use…
user2704237
  • 351
  • 2
  • 4
  • 6
26
votes
4 answers

Java Delay/Wait

How do I delay a while loop to 1 second intervals without slowing down the entire code / computer it's running on to the one second delay (just the one little loop).
Gray Adams
  • 3,927
  • 8
  • 32
  • 39
26
votes
3 answers

How to create javascript delay function

I have a javascript file, and in several places I want to add a small delay, so the script would reach that point, wait 3 seconds, and then continue with the rest of the code. The best way that I thought of doing this was to create a function, which…
user2370460
  • 7,470
  • 10
  • 31
  • 46
25
votes
2 answers

Can I put delay(500) before an addClass()?

$(document).ready(function(){ $("#info-text-container").click(function(){ $("#info-text").delay(500).addClass("info-text-active"); }); }); This does not put an delay on it when it gets clicked. Which I want to accomplish. Why and…
user2097217
  • 419
  • 1
  • 9
  • 17
25
votes
3 answers

fade out div after x seconds with jquery

I do a fade in div that is not displayed when I load the page: $('#overlay').fadeIn('fast'); $('#box').fadeIn('slow'); I would do this instructions after x seconds, doing a fadeOut of the…
michele
  • 26,348
  • 30
  • 111
  • 168