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
24
votes
12 answers

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 { Thread.sleep(1); } catch…
user2918193
  • 259
  • 1
  • 2
  • 5
24
votes
11 answers

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 rendering (the iframe is in a hidden that will not…
Sean
  • 344
  • 1
  • 2
  • 8
23
votes
3 answers

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), it does not work properly. I've tried adding the…
user2220474
  • 293
  • 1
  • 4
  • 15
22
votes
4 answers

jQuery delay() - how to stop it?

I already tried stop(true,true), stop(true) and clearQueue(); but this doesn't work. I have problem with fast changing slides, i already have some function what have to reset everything, but it doesn't work. function reset(){ …
rojikada
  • 347
  • 1
  • 3
  • 9
22
votes
10 answers

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 successfully as follows: $sendTime =…
Ryan
  • 22,332
  • 31
  • 176
  • 357
22
votes
4 answers

How to delay a loop in android without using thread.sleep?

I wanted to delay a for loop without using Thread.sleep because that method make my whole application hang. I tried to use handler but it doesn't seems to work inside a loop. Can someone please point out the mistake in my code. public void…
user3153613
  • 255
  • 1
  • 2
  • 10
21
votes
4 answers

What is the difference between Future.delayed vs Timer in flutter

I like to know the differences between Future.delayed and Timer method for delaying code execution. Both seem to do the same thing. Future.delayed Future.delayed(const Duration(milliseconds: 500), () { /*code*/ }); VS Timer Timer _timer = new…
bingcheng45
  • 398
  • 4
  • 14
21
votes
3 answers

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 bug in the MockWebServer. Also, the API has since…
fgysin
  • 11,329
  • 13
  • 61
  • 94
21
votes
1 answer

Task.Delay never completing

The following code will freeze forever. public async Task DoSomethingAsync() { await Task.Delay(2000); } private void Button_Click(object sender, RoutedEventArgs e) { DoSomethingAsync().Wait(); // Task.Delay(2000).Wait(); } If I switch…
Matthew Finlay
  • 3,354
  • 2
  • 27
  • 32
20
votes
2 answers

Jquery delay() function

I have some jquery and am trying to apply a delay to it but can't seem to get it to work. The current jquery is as follows... image.css({"visibility" : "hidden"}).removeClass("image-background"); and I have tried ammending this according to the…
Phil
  • 1,610
  • 4
  • 26
  • 40
20
votes
3 answers

Why can't I delay a remove call with jQuery

I would like for a div to fadeOut and then be removed: $('#div').delay(1000).fadeOut(300); $('#div').delay(1300).remove(); Unfortunately, this just directly removes the div, with no delays. Why is it that I can't get the remove action to be…
jay
  • 12,066
  • 16
  • 64
  • 103
20
votes
4 answers

delay() or timeout with stop()?

$('.file a').live('mouseenter', function() { $('#download').stop(true, true).fadeIn('fast'); }).live('mouseleave', function() { $('#download').stop(true, true).fadeOut('fast'); }); I want the mouseenter function to have a stop() and a delay…
matt
  • 42,713
  • 103
  • 264
  • 397
19
votes
4 answers

Can I use .delay() together with .animate() in jQuery?

I have this code, which slides open a basket preview on a website I am working on. It stays open if the user is hovered on it, but I want it to have a two second delay before the callback for my hover is triggered. This is just in case the user…
Sabai
  • 1,579
  • 5
  • 24
  • 40
19
votes
5 answers

How to set delay in Android onClick function

) I'm in a process of creating a memory game. My problem is that whenever i click for the second time, i can't even see toggled button. To be clear - first click toggles the togglebutton, so i can see the number it holds, the second click on a…
Piotrgo
  • 305
  • 1
  • 2
  • 8
19
votes
3 answers

Is process in VHDL reentrant?

Is it possible two or more sequential run for a process in VHDL? What will happen if another event happen (on sensitivity signal list) while the sequential execution of a process is not completed ? Is it possible or my VHDL model in mind for…
mohtashami740
  • 336
  • 2
  • 6