Hi!,
My shell script takes a quite a long time to execute.. Nothing appears on the screen during this period.. User are left guessing... whats going on????????????
Any ideas on how to create a small timer script which print a word on screen say " wait.. Program running" after every 10 seconds... (3 Replies)
Hi,
I am trying to do the following using AWK program.
1. Read the input data file
2. Parse the record and see if it contains errors
3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen
Here is what I have done -... (6 Replies)
Hi All,
Please help me writing the below script.
I have two sql queries.
1. Select count(1),Client_id from TABLE_A group by Client_id;
2. Select count(1),Client_id from TABLE_B group by Client_id;
I need the output of above two sql queries in a single file. The output 2nd query should be... (4 Replies)
Hi
I have developed bash script to connect to database and execute .sql files. I am logging some statements in to log file using echo. While logging I am adding the date in front of the log statements which makes sense. I am unable to add date in front of output from the sqlplus and sqlldr,... (8 Replies)
How do you set timer as output to the command line so that you get an output like
Has been waiting for 5 seconds
Has been waiting for 6 seconds
...
Where only the number changes. (2 Replies)
Hi,
I have 1000 files names data1.txt through data1000.txt inside a folder. I want to write a script that will take each first line from the files and write them as output into a new file. How do I go about doing that? Thanks! (2 Replies)
Hi All,
I have an input file containing data as below:
Input.DAT
XXXXXXX|YYYYYYY|ZZZZZZZZZZ|12334446456|B|YY|111111111|111111111|111111111|111111111|15|3|NNNNNN|Y|3|AAA|111111111... (11 Replies)
Hi
I am trying to write output to a file in columns
I have file in the follwoing:
# cat file
abc
def
#
I am trying to write next output as like
# cat file
abc 123
def 345
#
:mad: (6 Replies)
HI
I am trying to grep 3 characters from hostname and append a character at the end.
I tried as in the following:
root@abag3:~# hostname | cut -c1-3
hyu
Now I am trying to append "g" at the end of this output as in the following.
root@abag3:~# hostname | cut -c1-3 | sed -s... (4 Replies)
Hello,
I am having problem while redirecting output to a file where as on console output is proper.
for dir in */; do printf "%s, " "$dir"; ls -m "$dir"; echo; done > output.txt
Output of above command is coming in single line but when i am redirecting output to a file, single line i... (10 Replies)
Discussion started by: Manoj Rajput
10 Replies
LEARN ABOUT SUSE
log::log4perl::util::timetracker
Util::TimeTracker(3) User Contributed Perl Documentation Util::TimeTracker(3)NAME
Log::Log4perl::Util::TimeTracker - Track time elapsed
SYNOPSIS
use Log::Log4perl::Util::TimeTracker;
my $timer = Log::Log4perl::Util::TimeTracker->new();
# equivalent to Time::HiRes::gettimeofday(), regardless
# if Time::HiRes is present or not.
my($seconds, $microseconds) = $timer->gettimeofday();
# reset internal timer
$timer->reset();
# return milliseconds since last reset
$msecs = $timer->milliseconds();
# return milliseconds since last call
$msecs = $timer->delta_milliseconds();
DESCRIPTION
This utility module helps tracking time elapsed for PatternLayout's date and time placeholders. Its accuracy depends on the availability of
the Time::HiRes module. If it's available, its granularity is milliseconds, if not, seconds.
The most common use of this module is calling the gettimeofday() method:
my($seconds, $microseconds) = $timer->gettimeofday();
It returns seconds and microseconds of the current epoch time. If Time::HiRes is installed, it will simply defer to its gettimeofday()
function, if it's missing, time() will be called instead and $microseconds will always be 0.
To measure time elapsed in milliseconds, use the reset() method to reset the timer to the current time, followed by one or more calls to
the milliseconds() method:
# reset internal timer
$timer->reset();
# return milliseconds since last reset
$msecs = $timer->milliseconds();
On top of the time span between the last reset and the current time, the module keeps track of the time between calls to
delta_milliseconds():
$msecs = $timer->delta_milliseconds();
On the first call, this will return the number of milliseconds since the last reset(), on subsequent calls, it will return the time elapsed
in milliseconds since the last call to delta_milliseconds() instead. Note that reset() also resets the time of the last call.
The internal timer of this module gets its time input from the POSIX time() function, or, if the Time::HiRes module is available, from its
gettimeofday() function. To figure out which one it is, use
if( $timer->hires_available() ) {
print "Hooray, we get real milliseconds!
";
} else {
print "Milliseconds are just bogus
";
}
For testing purposes, a different time source can be provided, so test suites can simulate time passing by without actually having to wait:
my $start_time = time();
my $timer = Log::Log4perl::Util::TimeTracker->new(
time_function => sub {
return $start_time++;
},
);
Every call to $timer->epoch() will then return a time value that is one second ahead of the the value returned on the previous call. This
also means that every call to delta_milliseconds() will return a value that exceeds the value returned on the previous call by 1000.
COPYRIGHT AND LICENSE
Copyright 2002-2009 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.1 2010-02-07 Util::TimeTracker(3)