ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:
use warnings; use strict; use Win32::GuiTest qw(:ALL); until(my @window3=FindWindowLike(undef,"calculator")) { print("\ncan't find window\n"); sleep 1; } print("Calculator is not opened\n");
I've written a piece of my code here which searches for a window title "Calculator" and prints a message can't find window till it does not find the required window.
I want to search for calculator window only for 30 seconds and if the search result is still negative after 30 seconds I want to come out of the until loop and print calculator is not opened.
How to run this section of code for 30 seconds?
Any suggestions or help is appreciated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Run a section of code for a particular amount of time ?
by marto (Cardinal) on Nov 11, 2016 at 09:54 UTC | |
|
Re: How to Run a section of code for a particular amount of time ?
by GrandFather (Saint) on Nov 11, 2016 at 09:56 UTC | |
|
Re: How to Run a section of code for a particular amount of time ?
by choroba (Cardinal) on Nov 11, 2016 at 09:53 UTC | |
|
Re: How to Run a section of code for a particular amount of time ?
by Ratazong (Monsignor) on Nov 11, 2016 at 09:54 UTC |