Re: timing out threads

2011-11-01 Thread Zachary Zebrowski
Hi, $0.02 Look on cpan for the various proc:: modules. If you're doing something like a file copy, and need to shell out to do something, consider looking at : http://search.cpan.org/~bzajac/Proc-Background-1.10/lib/Proc/Background.pm. For me, it works when I need to do something on the command l

timing out threads

2011-11-01 Thread Danny Wong (dannwong)
Hi all, I would like to perform the following, start X (say 10) number of threads to perform some operation (ex. Copy command), I would like to exit or return out of the thread(s) that takes too long ( ex. 30 minutes ). I'm thinking I should spawn an independent thread (a watch thread) and

Re: timing a fork

2008-08-24 Thread Raymond Wan
Hi Rob, Sorry for the delay -- enjoyed the weekend away from the computer. :-) Rob Dixon wrote: Raymond Wan wrote: Rob Dixon wrote: use strict; use warnings; $|++; # autoflush $SIG{CHLD} = 'IGNORE'; my $kid = fork; if ($kid) { print "in parent whose kid is $kid\n"; sleep 10

Re: timing a fork

2008-08-22 Thread Rob Dixon
; > uncontrollably... :-) > > That is why I want the child process to be detached. Wanting that > causes them to be zombies, so then the problem gets bigger and bigger. > > To be honest, I started by searching for "modperl" and "starting a > process" on t

Re: timing a fork

2008-08-22 Thread Raymond Wan
and found some lines of code resembling what I first posted and have since been modifying that. I haven't taken a long, hard look at each individual line to see if it is correct or not applicable for my problem. (No code I have found on the Net has addressed the issue of timing that proces

Re: timing a fork

2008-08-22 Thread Rob Dixon
Raymond Wan wrote: > Rob Dixon wrote: >> >> What do you need to accomplish that something as simple as the code below >> won't do? >> >> use strict; >> use warnings; >> >> my $kid = fork; >> >> if ($kid) { >> print "in parent whose kid is $kid\n"; >> } >> elsif ($kid == 0) { >> print "In child

Re: timing a fork

2008-08-21 Thread Raymond Wan
Hi Rob, H, true -- I may be adding and adding code unnecessarily... What the forked process does is run a C++ program and it is that program that needs to be timed. Would the code below accomplish that? I mean, having "times" in the Perl script that calls that C++ program will give th

Re: timing a fork

2008-08-21 Thread Rob Dixon
Raymond Wan wrote: > > Thank you very much for your reply! I've actually been stuck on this > for a while...but with little knowledge about forking processes, I was a > quite stuck. > > John W. Krahn wrote: >> perldoc -f times > > Ah, didn't know about that. I thought to get user time, you h

Re: timing a fork

2008-08-20 Thread Raymond Wan
Hi John, Thank you very much for your reply! I've actually been stuck on this for a while...but with little knowledge about forking processes, I was a quite stuck. John W. Krahn wrote: perldoc -f times Ah, didn't know about that. I thought to get user time, you had to run something (s

Re: timing a fork

2008-08-20 Thread John W. Krahn
Raymond Wan wrote: Hi all, Hello, I'm trying to fork a process under modperl for a web server, but I've realized that the problem / misunderstanding that I'm having is unrelated to modperl...I get the same problem under Perl. What I want to do is to fork a child process (non-perl program

timing a fork

2008-08-19 Thread Raymond Wan
Hi all, I'm trying to fork a process under modperl for a web server, but I've realized that the problem / misunderstanding that I'm having is unrelated to modperl...I get the same problem under Perl. What I want to do is to fork a child process (non-perl program), but also time how long it

stat and timing out on SIGALRM

2008-03-13 Thread Cort Morgan
Hi, I'm trying to check a list of filenames to see if they actually exist. A problem arises if the file is located on a known server but cannot be contacted (ping times out). It seems that perl doesn't timeout, but waits for the stat call to return. My code is based on code taken from the Per

timing a program run

2008-03-08 Thread ANJAN PURKAYASTHA
thanks to all who replied to my earlier post. just tried out NYTProfiler on my Mac OSX. it worked like a charm! cheers, anjan -- ANJAN PURKAYASTHA, PhD. Senior Computational Biologist == 1101 King Street, Suite 310, Alexandria, VA 22314. 703.518.8040 (office) 703.740.693

Re: timing a program

2008-03-08 Thread ANJAN PURKAYASTHA
thanks all ! just tried NYTProfiler. worked like a charm! anjan On Sat, Mar 8, 2008 at 1:24 PM, zentara <[EMAIL PROTECTED]> wrote: > On Sat, 8 Mar 2008 11:27:01 -0500, [EMAIL PROTECTED] ("ANJAN > PURKAYASTHA") wrote: > > >i would like to find out how much time my program or a couple of steps > >

Re: timing a program

2008-03-08 Thread Richard Lee
ANJAN PURKAYASTHA wrote: i would like to find out how much time my program or a couple of steps within my program took to run. any idea what command/module i need to use? tia, anjan either just use time program OR read this article. http://www.stonehenge.com/merlyn/UnixReview/col49.ht

Re: timing a program

2008-03-08 Thread Gunnar Hjalmarsson
ANJAN PURKAYASTHA wrote: i would like to find out how much time my program or a couple of steps within my program took to run. any idea what command/module i need to use? I guess you want the Benchmark module. -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscr

Re: timing a program

2008-03-08 Thread John W. Krahn
ANJAN PURKAYASTHA wrote: i would like to find out how much time my program or a couple of steps within my program took to run. any idea what command/module i need to use? http://search.cpan.org/~jaw/Devel-Profile-1.05/ http://search.cpan.org/~akaplan/Devel-NYTProf-0.05/ John -- Perl isn't a

timing a program

2008-03-08 Thread ANJAN PURKAYASTHA
i would like to find out how much time my program or a couple of steps within my program took to run. any idea what command/module i need to use? tia, anjan -- ANJAN PURKAYASTHA, PhD. Senior Computational Biologist == 1101 King Street, Suite 310, Alexandria, VA 22314.

Timing of MainWindow Display

2006-05-30 Thread robert . w . sturdevant
Hi List, I have an app that does a lot of initialization like this: Use Tk: &BuildMainWindow; &Initialize; Mainloop; The problem is that Initialize{} now takes about 20 seconds to start services, etc. and $mw remains unmapped for that time. Is there a way to map $mw as soon as it is

Mechanize, testing and timing.

2005-05-07 Thread Chris
Greetings, We have written a web application utilizing mod_perl and MySQL. We have also written testing scripts using WWW::Mechanize that simulate a user. These scripts were first developed as test scripts to ensure actions were performed correctly, etc. We would now like to take these scripts

Always Timing Out in Net::Telnet :(

2004-02-10 Thread Thind, Aman
Hello Friends, I have to run a command on my unix box through a script running on my windows m/c. Here's my code which is nothing but the example in perldoc of the module : use Net::Telnet (); $username = "myusername"; $passwd = "mypasswd"; $t = new Net::Telnet (Timeout => 10, Prompt => '/login

RE: Timing out without alarm function

2004-02-03 Thread Sam Masiello
Thank you very much, Daniel! --Sam Daniel Staal wrote: > --As off Tuesday, February 3, 2004 10:09 AM -0700, Sam Masiello is > alleged to have said: > >> I have a script where I am sending some data over a socket, but after >> X seconds I want the operation to time out. I am currently using >

Re: Timing out without alarm function

2004-02-03 Thread Daniel Staal
--As off Tuesday, February 3, 2004 10:09 AM -0700, Sam Masiello is alleged to have said: I have a script where I am sending some data over a socket, but after X seconds I want the operation to time out. I am currently using alarm to enforce the timeout, but I don't want the script to die. I wan

Timing out without alarm function

2004-02-03 Thread Sam Masiello
Hi all! I am new to the list, and have a question which I hope isn't too difficult to answer. I have a script where I am sending some data over a socket, but after X seconds I want the operation to time out. I am currently using alarm to enforce the timeout, but I don't want the script to die.

Re: Timing an operation

2003-12-19 Thread drieux
On Dec 18, 2003, at 4:22 PM, HENRY,MARK (HP-Roseville,ex1) wrote: [..] Any other recommendations? [..] cf perldoc time my $starttime = time; cmd_foo_here my $stoptime = time; ciao drieux --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Timing an operation

2003-12-19 Thread HENRY,MARK (HP-Roseville,ex1)
Dear All, Merry Christmas!! Wondering if someone can recommend the best way to time an operation within a script. I'm using Net:FTP to check transmission times on files to various computers for later comparison. I see the benchmark module, but I'm thinking take a timestamp, running the ftp tr

RE: Timing several processes

2003-12-04 Thread Akens, Anthony
e end it will meet the goal that management put forth, which is what keeps me paid :) -Tony -Original Message- From: drieux [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 7:24 PM To: Perl Perl Subject: Re: Timing several processes On Dec 3, 2003, at 10:49 AM, Akens, Ant

Re: Timing several processes

2003-12-03 Thread drieux
On Dec 3, 2003, at 5:01 PM, Wiggins d'Anconia wrote: [..] it might be a framework you could rip off and use: Have we come back to POE? POE. ;-) who knows, after a bit of work the OP may decide that the 400m of downloadable free software

Re: Timing several processes

2003-12-03 Thread Wiggins d'Anconia
drieux wrote: So while you are in the process of learning fork() and exec() why not think a bit more agressively and go with say a pipe to pass back the information so as not to buy the IO overhead of writing to files? While the following was written for a command line 'let us get interactive

Re: Timing several processes

2003-12-03 Thread drieux
On Dec 3, 2003, at 10:49 AM, Akens, Anthony wrote: [..] print "Running vmstat\n"; defined(my $vmstat_pid = fork) or die "Cannot fork: $!"; unless ($vmstat_pid) { exec "vmstat 5 5 > /log/monitor/delta/vmstat.out"; die "cannot exec vmstat: $!"; } print "Running sar\n"; defined(my $sar_pid = fork)

RE: Timing several processes

2003-12-03 Thread Akens, Anthony
ony Sent: Wednesday, December 03, 2003 1:50 PM To: Wiggins d Anconia; Tom Kinzer; [EMAIL PROTECTED] Subject: RE: Timing several processes Here's the sample code I'm trying... In essence I would expect to see The following output: Running vmstat Running sar Waiting... (at this point a

RE: Timing several processes

2003-12-03 Thread Akens, Anthony
ut"; die "cannot exec date: $!"; } print "Waiting...\n"; waitpid($vmstat_pid, 0); waitpid($sar_pid, 0); print "done!\n"; -Original Message- From: Wiggins d Anconia [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 1:31 PM To: Akens, Anthony;

RE: Timing several processes

2003-12-03 Thread Wiggins d Anconia
gt; information and return the results. > > The only bit I'm not sure of is how to tell if all forked processes > have completed before moving on. > > > -Tony > > -Original Message- > From: Tom Kinzer [mailto:[EMAIL PROTECTED] > Sent: Wednesday, Decembe

RE: Timing several processes

2003-12-03 Thread Tom Kinzer
ime. Of course, all this has very little to do with terminating a child at a certain time... -Tom Kinzer -Original Message- From: Akens, Anthony [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 10:07 AM To: Akens, Anthony; Tom Kinzer; [EMAIL PROTECTED] Subject: RE: Timing se

RE: Timing several processes

2003-12-03 Thread Tom Kinzer
Right. POE may be a good tool for handling those children processes. (Instead of forking at all.) -Tom Kinzer -Original Message- From: Akens, Anthony [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 9:58 AM To: Tom Kinzer; [EMAIL PROTECTED] Subject: RE: Timing several

RE: Timing several processes

2003-12-03 Thread Akens, Anthony
w I'm looking at using 5 different tools that I want to monitor). -Tony -Original Message- From: Akens, Anthony Sent: Wednesday, December 03, 2003 12:58 PM To: Tom Kinzer; [EMAIL PROTECTED] Subject: RE: Timing several processes I already have some ideas for how I want to build the p

RE: Timing several processes

2003-12-03 Thread Akens, Anthony
sure of is how to tell if all forked processes have completed before moving on. -Tony -Original Message- From: Tom Kinzer [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 12:35 PM To: [EMAIL PROTECTED] Subject: RE: Timing several processes http://poe.perl.org Maybe this

RE: Timing several processes

2003-12-03 Thread Tom Kinzer
http://poe.perl.org Maybe this would be a good job for POE? -Tom Kinzer -Original Message- From: Akens, Anthony [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 03, 2003 7:49 AM To: [EMAIL PROTECTED] Subject: Timing several processes Hi all! I'm wanting to write a simpl

Re: Timing several processes

2003-12-03 Thread Casey West
It was Wednesday, December 03, 2003 when Akens, Anthony took the soap box, saying: : Hi all! : : I'm wanting to write a simple web-based tool to see the status : of several servers at a glance. I know there are many solutions : existing, but I can't learn as much about perl by just using one : o

Timing several processes

2003-12-03 Thread Akens, Anthony
Hi all! I'm wanting to write a simple web-based tool to see the status of several servers at a glance. I know there are many solutions existing, but I can't learn as much about perl by just using one of those as I can by writing my own. The first step I want to do is call a script from cron th

timing out a system call

2003-08-14 Thread Niall Flinn
Hi folks, I'm writing my first actual useful perl scripts and I've run into the following problem - I'm using the "system" function to run a command line process (a 3d renderer, as it happens) from within my script. This works fine, except that sometimes the process hangs and leaves my perl

Re: timing out a system call

2003-08-14 Thread denis
On Thu, 14 Aug 2003, Niall Flinn wrote: > Hi folks, > > I'm writing my first actual useful perl scripts and I've run into the following > problem - I'm using the "system" function to run a command line process (a 3d > renderer, as it happens) from within my script. This works fine, except t

Re: timing out a system call

2003-08-14 Thread denis
Forgot to mention that most of the "guts" for this was given to me by some of the kind folks on this mailing list.. Just wanted to give credit where credit was due.. Denis On Thu, 14 Aug 2003 [EMAIL PROTECTED] wrote: > On Thu, 14 Aug 2003, Niall Flinn wrote: > > > Hi folks, > > > > I'm

Re: Timing an execution of an command

2003-02-04 Thread Jenda Krynicky
From: "Distribution Lists" <[EMAIL PROTECTED]> > I've written some Perl code that will make use of LDAP modules and > will do an LDAPSEARCH to a specific ldap server. However, I would like > to know the time take to complete the LDAPSEARCH so I can graph the > response time. What can I do within P

Timing an execution of an command

2003-02-04 Thread Distribution Lists
I've written some Perl code that will make use of LDAP modules and will do an LDAPSEARCH to a specific ldap server. However, I would like to know the time take to complete the LDAPSEARCH so I can graph the response time. What can I do within Perl to measure the completion time of the search ? Any

Re: Timing the response

2003-01-13 Thread Mark Goland
you can try to use alarm and time your aperation. if times expires catch sig{alar}, and do your erro stuff inside . Mark - Original Message - From: "Najamuddin, Junaid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 13, 2003 5:03 PM Subject: Timi

Timing the response

2003-01-13 Thread Najamuddin, Junaid
Hi, Due to a latency issue I want to time a particular intranet web page response It is a web page that looks for the dsl availability for an address being input When you hit submit it checks for the availability of dsl and output a response I want to time that response from the time the user hit

RE: timing

2002-10-22 Thread Beau E. Cox
nti [mailto:walter@;waltervalenti.it] Sent: Tuesday, October 22, 2002 1:19 AM To: [EMAIL PROTECTED] Subject: timing Hi, if i exec sleep $tm, the process sleeps for a time beetwen $tm-1 and $tm seconds. If i want do sleep the process for a time $tm +/- $delta with $delta << $tm ?

timing

2002-10-22 Thread walter valenti
Hi, if i exec sleep $tm, the process sleeps for a time beetwen $tm-1 and $tm seconds. If i want do sleep the process for a time $tm +/- $delta with $delta << $tm ? Is possible ??? Thanks Walter -- God hates us all Per favore non mandatemi allegati in Word o PowerPoint. Si veda http

Re: timing delays

2002-08-14 Thread drieux
On Wednesday, August 14, 2002, at 04:21 , Joe Mecklin wrote: > Thanks for all the leads and suggestions. I couldn't quite wrap my mind > around making select() work for what I want but Time::HiRes works great. > > Joe [..] >> >> http://search.cpan.org/author/JHI/perl-5.8.0/ext/Time/HiRes/HiRes.

Re: timing delays

2002-08-14 Thread Joe Mecklin
Thanks for all the leads and suggestions. I couldn't quite wrap my mind around making select() work for what I want but Time::HiRes works great. Joe On Tue, 2002-08-13 at 14:55, drieux wrote: > > On Tuesday, August 13, 2002, at 12:20 , Joe Mecklin wrote: > > > I'm trying to send a file as a

Re: timing delays

2002-08-13 Thread John W. Krahn
Joe Mecklin wrote: > > I'm trying to send a file as a remote configuration download via telnet > in a Perl script (using net::telnet). I need to introduce sub-second > delays between sending each line so the receiving system doesn't get > confused. Sleep only goes down to a single second; is th

RE: timing delays

2002-08-13 Thread Bob Showalter
> -Original Message- > From: Joe Mecklin [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 13, 2002 3:20 PM > To: [EMAIL PROTECTED] > Subject: timing delays > > > I'm trying to send a file as a remote configuration download > via telnet > in a Perl

Re: timing delays

2002-08-13 Thread drieux
On Tuesday, August 13, 2002, at 12:20 , Joe Mecklin wrote: > I'm trying to send a file as a remote configuration download via telnet > in a Perl script (using net::telnet). I need to introduce sub-second > delays between sending each line so the receiving system doesn't get > confused. Sleep o

timing delays

2002-08-13 Thread Joe Mecklin
I'm trying to send a file as a remote configuration download via telnet in a Perl script (using net::telnet). I need to introduce sub-second delays between sending each line so the receiving system doesn't get confused. Sleep only goes down to a single second; is there something that can inject

Re: Timing execution of a sub

2002-05-15 Thread drieux
On Wednesday, May 15, 2002, at 04:51 , Tor Hildrum wrote: > Are there any tricks to time the execution of a sub? > Specifically I'm using the Fisher-Yates shuffle, using an array with a > couple of million numbers. I want to time the shuffle. you want perldoc Benchmark if you would li

RE: Timing execution of a sub

2002-05-15 Thread Jackson, Harry
>-Original Message- >From: Tor Hildrum [mailto:[EMAIL PROTECTED]] > > >Are there any tricks to time the execution of a sub? >Specifically I'm using the Fisher-Yates shuffle, using an array with a >couple of million numbers. I want to time the shuffle. The module Benchmark. Drieux has go

Timing execution of a sub

2002-05-15 Thread Tor Hildrum
Are there any tricks to time the execution of a sub? Specifically I'm using the Fisher-Yates shuffle, using an array with a couple of million numbers. I want to time the shuffle. Tor -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Timing Out A Loop

2001-11-29 Thread Karthik Krishnamurthy
ed down or unresponsive. I'd like to > include a timing mechanism that basically > says after 10 secs, quit trying to get > the page and move on. > Some sample code: > > > my $url = "http://$host:$port/page";; > my $ua = LWP::UserAgent->new(); >

Timing Out A Loop

2001-11-29 Thread Ken Hammer
Hi all, I have a script that goes out and "grabs" a specific HTML page. I then search through the page, gathering the info I want. Sometimes, the site I'm hitting is either bogged down or unresponsive. I'd like to include a timing mechanism that basically says after 10 secs

RE: Timing a form

2001-09-05 Thread Bob Showalter
> -Original Message- > From: Georg Fendt [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 05, 2001 2:23 AM > To: [EMAIL PROTECTED] > Subject: Timing a form > > ... > QUESTION: I would like to put a timer to the form with the > questions, that is >

Re: Timing a form

2001-09-05 Thread Jos I. Boumans
2 seconds of thinking says you MIGHT be able to use the meta refresh option just tell it to redirect to the submit page after x seconds, maybe sending a cookie along that says when they *got* the page, so you know they'r enot cheating. not sure if this is an adequate solution, but it's a fairly s

Timing a form

2001-09-05 Thread Georg Fendt
Dear all: I'm doing my first program with Perl and my knowledge is quite limited but I'm feeding my little Llama...(still cannot understand the quiz example done by Randal in his column...) My program does a multiple question quiz with multiple options valid for each question, to be running u