delay

(MS-DOS) Time Delays

吃可爱长大的小学妹 提交于 2019-12-12 17:17:54
问题 I came past a few ways to cause a time delay such as pings and dirs. Though none of them are really precise, is there anny proper way to cause a time delay? I heard about a few things though they don't work on all computers, not on my Windows XP nor the Windows NT at college. It takes ages going through all files on Google finding a good answer, and since I didn't yet find the question on Stack Overflow I thought it might be good to just create the question myself ;) 回答1: Sleep It will allow

Transmitting data continuously from Chrome for Android to Node.js server using Socket.io

馋奶兔 提交于 2019-12-12 15:22:49
问题 I need to transmit the touch position in Chrome for Android continuously to a Node.js server using Socket.io . However, I guess, the transmission is too fast. The first few values receive the server (For the first touch about six values, later only two or three values), then there seems to be a traffic jam. For many seconds the server receives nothing. Then, suddenly all missed values suddenly arrive at the server. But not continuously... I think I must reduce the traffic from client to

Executing an exec() or system() in PHP and do not wait for output

我的梦境 提交于 2019-12-12 08:55:34
问题 I want to trigger a shell command in eider exec() or system() from PHP script but it is a task that take a while to complete, is there a way to trigger it and continue running the PHP page load without delay? Edit: I am on CentOS 6, PHP 5.3 回答1: Depends on the OS you are using. For linux: pclose(popen("php somefile.php &","r")); notice the amperstand at the end (very important). For windows: pclose(popen("start php.exe somefile.php","r")); here the start keyword is important. Hope this helps.

C Beginner: Can't use delay() in a simple C program

醉酒当歌 提交于 2019-12-12 05:50:06
问题 test1.c #include <stdio.h> int main(void) { printf("test\n"); delay(1000); printf("test2\n"); } When I try to compile... gcc test1.c -o test1 Undefined symbols for architecture x86_64: "_delay", referenced from: _main in ccUnw3tY.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status Certainly there is a lesson here in knowing your libraries and what linking is etc... What am I missing? I am trying to do this on OSX. 回答1: There's no delay function in C, you have

Android - Large amount of tie taken to check Internet connectivity using ping

可紊 提交于 2019-12-12 05:49:33
问题 I have written some code to ping Google to check Internet connectivity. The app works except that it takes a lot of time to send back the response (up-to 1 min). This happens especially when Mobile Network is turned ON but there is no Internet connectivity I would appreciate it if you would help me find a solution The layout consists of just a Button. Following is my Java code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout

loop and delay problem

若如初见. 提交于 2019-12-12 05:29:34
问题 I am trying to make a little application that simulates the dice. I want the picture of the dice side randomly change 6 times after clicking the button. It should randomly change 6 times with 0,3 second delay after every random change. The problem is that it changes always only one time not six times as wished. I guess it will be just some trivial mistake but I could not find the right answer anywhere on the web. Here is the code and I thank u all in advance: import java.util.Random; import

Poptorootviewcontroller with delay

这一生的挚爱 提交于 2019-12-12 04:53:12
问题 I have a method "test" that execute poptorootviewcontroller. I want to put some delay before the animation of poptorootviewcontroller. Here is my code : -(void)test{ [UIView animateWithDuration:5.0 delay: 2.5 options: UIViewAnimationOptionCurveEaseIn animations:^{ [self.navigationController popToRootViewControllerAnimated:NO]; } completion:nil]; } But it doesn't work. Any help? Thanks! 回答1: The code you posted is for performing an animation, not delaying. A good solution would be to use

How does #delay work for verilog non blocking statements?

拜拜、爱过 提交于 2019-12-12 04:43:23
问题 What will be printed for A and B in the second $display statement? module blocking; reg[0:7] A, B; initial begin A = 3; #1 A = A + 1; B = A + 1; $display("Blocking: A= %d B= %d", A, B ); // A = 4, B = 5 A = 3; #1 A <= A + 1; B <= A + 1; #1 $display("Non-blocking: A= %d B= %d", A, B ); // A = ?, B = ? end endmodule Any pointers on how event scheduling in verilog works with respect to delays and non blocking statements will be really helpful. Thanks. 回答1: because you have #1 before the second

How do AVR Assembly BRNE delay loops work?

删除回忆录丶 提交于 2019-12-12 04:42:27
问题 An online delay loop generator gives me this delay loop of runtime of 0.5s for a chip running at 16MHz. The questions on my mind are: Do the branches keep branching if the register becomes negative? How exactly does one calculate the values that are loaded in the beginning? ldi r18, 41 ldi r19, 150 ldi r20, 128 L1: dec r20 brne L1 dec r19 brne L1 dec r18 brne L1 回答1: How exactly does one calculate the values that are loaded in the beginning? Calculate total amount of cycles => 0.5s * 16000000

Issue With Using dec to Create a Delay

孤人 提交于 2019-12-12 04:27:05
问题 I've started experimenting with Gameboy programming using Z80 assembly, but I've found something kind of weird. I found a snippet of code used to create a delay: simpleDelay: dec bc ld a,b or c jr nz, simpleDelay ret While playing around with that, I discovered that writing dec bc twice shortens the delay, but writing it 3 times makes the delay longer than using it once or twice. Why does having an even number of dec statements shorten the delay? EDIT: Here's the snippet of code calling the