Questions tagged [delay]

Delay refers to amount of time between two events.

delay
Filter by
Sorted by
Tagged with
3218 votes
13 answers
3.7m views

How do I make a time delay? [duplicate]

How do I put a time delay in a Python script?
user46646's user avatar
  • 156k
916 votes
36 answers
850k views

How to call a method after a delay in Android

I want to be able to call the following method after a specified delay. In objective c there was something like: [self performSelector:@selector(DoSomething) withObject:nil afterDelay:5]; Is there ...
aryaxt's user avatar
  • 77k
399 votes
19 answers
534k views

How to create a delay in Swift?

I want to pause my app at a certain in point. In other words, I want my app to execute the code, but then at a certain point, pause for 4 seconds, and then continue on with the rest of the code. How ...
Schuey999's user avatar
  • 4,826
385 votes
1 answer
1.4m views

JavaScript sleep/wait before continuing [duplicate]

I have a JavaScript code that I need to add a sleep/wait function to. The code I am running is already in a function, eg: function myFunction(time) { alert('time starts now'); //code to make ...
user2370460's user avatar
  • 7,620
364 votes
12 answers
1.2m views

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 ...
DA.'s user avatar
  • 40.3k
307 votes
10 answers
404k views

How to run code after some delay in Flutter?

I'd like to execute a function after a certain delay after my Widget is built. What's the idiomatic way of doing this in Flutter? What I'm trying to achieve: I'd like to start with a default ...
Bradley Campbell's user avatar
192 votes
11 answers
190k views

jQuery: Can I call delay() between addClass() and such?

Something as simple as: $("#div").addClass("error").delay(1000).removeClass("error"); doesn't seem to work. What would be the easiest alternative?
serg's user avatar
  • 110k
180 votes
4 answers
759k views

How to add a delay for a 2 or 3 seconds [closed]

How can I add a delay to a program in C#?
Mulder's user avatar
  • 1,973
178 votes
10 answers
594k views

jQuery: Wait/Delay 1 second without executing code

I can't get the .delay method working in jQuery: $.delay(3000); // not working $(queue).delay(3000); // not working I'm using a while loop to wait until an uncontrolled changing value is greater ...
Nahydrin's user avatar
  • 13.3k
164 votes
4 answers
178k views

Delaying function in swift [duplicate]

I don't have a code to sample or anything, because I have no idea how to do it, but can someone please tell me how to delay a function with swift for a set amount of time?
CoolMAn's user avatar
  • 1,861
149 votes
13 answers
143k views

How to put a delay on AngularJS instant search?

I have a performance issue that I can't seem to address. I have an instant search but it's somewhat laggy, since it starts searching on each keyup(). JS: var App = angular.module('App', []); App....
braincomb's user avatar
  • 1,636
133 votes
6 answers
31k views

How to reduce iOS AVPlayer start delay

Note, for the below question: All assets are local on the device -- no network streaming is taking place. The videos contain audio tracks. I'm working on an iOS application that requires playing ...
Bernie Habermeier's user avatar
121 votes
12 answers
174k views

Delayed function calls

Is there a nice simple method of delaying a function call whilst letting the thread continue executing? e.g. public void foo() { // Do stuff! // Delayed call to bar() after x number of ms ...
TK.'s user avatar
  • 47.1k
98 votes
3 answers
279k views

How can I delay a :hover effect in CSS?

Is there a way to delay the :Hover event without using JavaScript? I know there is a way to delay animations, but I haven't seen anything on delaying the :hover event. I'm building a son-of-...
Adam Youngers's user avatar
96 votes
15 answers
182k views

While variable is not defined - wait

I have a click event that is triggered from another place automatically for the first time. My problem is that it runs too soon, since the required variables are still being defined by Flash and web ...
JackLeo's user avatar
  • 4,650
96 votes
7 answers
140k views

CSS Animations with delay for each child element

I am trying to create a cascading effect by applying an animation to each child element. I was wondering if there is a better way to do it than this: .myClass img:nth-child(1){ -webkit-animation: ...
Seka's user avatar
  • 1,443
88 votes
7 answers
122k views

Adding delay between execution of two following lines

I need to add a delay between the execution of two lines in a(same) function. Is there any favorable option to do this? Note: I don't need two different functions to do this, and the delay must not ...
Krishna Raj Salim's user avatar
86 votes
5 answers
139k views

How can I use delay() with show() and hide() in Jquery

How can I use delay() with show() and hide() in Jquery ?
faressoft's user avatar
  • 19.4k
80 votes
5 answers
141k views

How to add random delays between the queries sent to Google to avoid getting blocked in python

I have written a program which sends more than 15 queries to Google in each iteration, total iterations is about 50. For testing I have to run this program several times. However, by doing that, after ...
Hossein's user avatar
  • 40.9k
74 votes
17 answers
68k views

RxJava delay for each item of list emitted

I'm struggling to implement something I assumed would be fairly simple in Rx. I have a list of items, and I want to have each item emitted with a delay. It seems the Rx delay() operator just shifts ...
athor's user avatar
  • 6,858
68 votes
5 answers
69k views

Delay or Wait-For Statement

I have a 500,000 line SQL script: UPDATE users SET region_id = 9814746 WHERE id = 101 AND region_id IS null; UPDATE users SET region_id = 9814731 WHERE id = 102 AND region_id IS null; UPDATE users SET ...
sharadov's user avatar
  • 1,038
59 votes
5 answers
162k views

How to minimize the delay in a live streaming with ffmpeg

i have a problem. I would to do a live streaming with ffmpeg from my webcam. I launch the ffserver and it works. From another terminal I launch ffmpeg to stream with this command and it works: sudo ...
Pasquale C.'s user avatar
57 votes
3 answers
76k views

Measure website load time with Python requests

I'm trying to build a tool for testing the delay of my internet connection, more specifically web site load times. I thought of using the python requests module for the loading part. Problem is, it's ...
cookM's user avatar
  • 963
57 votes
4 answers
28k views

Is setTimeout with no delay the same as executing the function instantly?

I am looking at some existing code in a web application. I saw this: window.setTimeout(function () { ... }) Is this the same as just executing the function content right away?
Aishwar's user avatar
  • 9,464
52 votes
6 answers
38k views

How to create a delayed queue in RabbitMQ?

What is the easiest way to create a delay (or parking) queue with Python, Pika and RabbitMQ? I have seen an similar questions, but none for Python. I find this an useful idea when designing ...
eandersson's user avatar
43 votes
4 answers
65k views

jQuery: append() object, remove() it with delay()

what's wrong with that? $('body').append("<div class='message success'>Upload successful!</div>"); $('.message').delay(2000).remove(); I want to append a success message to my html ...
matt's user avatar
  • 43.4k
41 votes
7 answers
48k views

How to create delay function in QML?

I would like to create a delay function in javascript that takes a parameter of amount of time to delay, so that I could use it do introduce delay between execution of JavaScript lines in my QML ...
Sнаđошƒаӽ's user avatar
41 votes
1 answer
6k views

How windows handle the clipboard interface with Xming?

My question comes from a problem: I Use Xming on Windows 7 to connect to a Linux host (through PuTTY) in order to start and display a gnome-terminal. I have some troubles using the Windows clipboard: ...
Jonathan's user avatar
  • 804
40 votes
11 answers
56k views

Dismiss UIAlertView after 5 Seconds Swift

I've created a UIAlertView that contains a UIActivityIndicator. Everything works great, but I'd also like the UIAlertView to disappear after 5 seconds. How can I Dismiss my UIAlertView after 5 ...
Serge Pedroza's user avatar
37 votes
6 answers
121k views

Flutter/Dart - Open a view after a delay

I'm trying to find a solution to open a view after a delay in a loading view. I have a View, in which there is a button and when I press it, the onPressed() method triggers a Navigator.of(Context)....
Tiziano Gioè's user avatar
37 votes
5 answers
212k views

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 ...
user2706003's user avatar
35 votes
17 answers
168k views

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 ...
developer's user avatar
  • 7,350
35 votes
4 answers
63k views

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's user avatar
  • 353
34 votes
4 answers
47k views

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! ...
user avatar
33 votes
7 answers
118k views

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 ...
Retro's user avatar
  • 333
33 votes
3 answers
11k views

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 ...
Kzqai's user avatar
  • 22.9k
32 votes
9 answers
77k views

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 ...
Kirk Ross's user avatar
  • 6,803
31 votes
5 answers
25k views

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){ ...
Sinan's user avatar
  • 5,909
30 votes
6 answers
66k views

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's user avatar
  • 5,895
28 votes
6 answers
231k views

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, ...
user2704237's user avatar
28 votes
4 answers
28k views

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's user avatar
  • 705
27 votes
3 answers
204k views

How to create javascript delay function [duplicate]

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 ...
user2370460's user avatar
  • 7,620
26 votes
4 answers
124k views

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's user avatar
  • 4,007
25 votes
2 answers
45k views

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 ...
user2097217's user avatar
25 votes
3 answers
76k views

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's user avatar
  • 26.4k
25 votes
12 answers
187k views

How to make java delay for a few seconds?

Hey all I have this code. I want to delay my program for a few seconds and display "scanning..." Here's what I have. This compiles but doesn't delay anything int i = 1; if (i == 1) { try ...
user2918193's user avatar
24 votes
11 answers
56k views

Delay load of iframe?

I know there are some tools and techniques for delaying the load of javascript, but I have an iframe that I would like to delay loading until after the rest of the page has finished downloading and ...
Sean's user avatar
  • 344
24 votes
3 answers
29k views

JQuery delay before fadeOut

I have written a jquery script that allows me to fade divs in and out, then repeat. The code works fine. However, when I try to add a delay (I want the div to stay up a few seconds before fading out), ...
user2220474's user avatar
24 votes
10 answers
47k views

How to cancel queued job in Laravel or Redis

How can I browse all the pending jobs within my Redis queue so that I could cancel the Mailable that has a certain emailAddress-sendTime pair? I'm using Laravel 5.5 and have a Mailable that I'm using ...
Ryan's user avatar
  • 23k
23 votes
4 answers
16k views

MockWebServer response delay - testing timeouts

I'm trying to test HTTP timeout scenarios using a MockWebServer which answers my test requests sent with Retrofit/OkHttp. (This question was asked before some years ago, but at the time concerned a ...
fgysin's user avatar
  • 11.6k

1
2 3 4 5
85