<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Elapsed time in a script? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746606#M944477</link>
    <description>I'm sure others are going to suggest the timex command. You can man timex, if you like. Here's my dumb and simple method:&lt;BR /&gt;&lt;BR /&gt;TIME_0=$(perl -e 'print time')&lt;BR /&gt;cmd1&lt;BR /&gt;cmd2&lt;BR /&gt;cmd3&lt;BR /&gt;TIME_NOW=$(perl -e 'print time')&lt;BR /&gt;&lt;BR /&gt;SECONDS=$((${TIME_NOW} - ${TIME_0}))&lt;BR /&gt;echo "Elapsed Time: ${SECONDS} seconds"&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
    <pubDate>Mon, 17 Jun 2002 21:57:24 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-06-17T21:57:24Z</dc:date>
    <item>
      <title>Elapsed time in a script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746605#M944476</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am trying to put some benchmarking data in my scripts. I would like to know if there is a way to easily calculate the amount of time that has passed. I can't just use date because some commands may run overnite. Any ideas?&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Kris</description>
      <pubDate>Mon, 17 Jun 2002 21:53:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746605#M944476</guid>
      <dc:creator>Kris Spander</dc:creator>
      <dc:date>2002-06-17T21:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Elapsed time in a script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746606#M944477</link>
      <description>I'm sure others are going to suggest the timex command. You can man timex, if you like. Here's my dumb and simple method:&lt;BR /&gt;&lt;BR /&gt;TIME_0=$(perl -e 'print time')&lt;BR /&gt;cmd1&lt;BR /&gt;cmd2&lt;BR /&gt;cmd3&lt;BR /&gt;TIME_NOW=$(perl -e 'print time')&lt;BR /&gt;&lt;BR /&gt;SECONDS=$((${TIME_NOW} - ${TIME_0}))&lt;BR /&gt;echo "Elapsed Time: ${SECONDS} seconds"&lt;BR /&gt;&lt;BR /&gt;Regards, Clay</description>
      <pubDate>Mon, 17 Jun 2002 21:57:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746606#M944477</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-17T21:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Elapsed time in a script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746607#M944478</link>
      <description>Thanks very much!! I had already used timex and it was not what I was looking for. I'm beginning to think that learning Perl is a must.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;BR /&gt;Kris</description>
      <pubDate>Mon, 17 Jun 2002 22:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746607#M944478</guid>
      <dc:creator>Kris Spander</dc:creator>
      <dc:date>2002-06-17T22:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Elapsed time in a script?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746608#M944479</link>
      <description>Hi Kris,&lt;BR /&gt;&lt;BR /&gt;          it is a bit ironically to be so late on a time question, but have you tried the ksh variable SECONDS?&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;#&lt;BR /&gt;# Show time!&lt;BR /&gt;#&lt;BR /&gt;TIME1=$SECONDS&lt;BR /&gt;sleep 5&lt;BR /&gt;TIME2=$SECONDS&lt;BR /&gt;echo $TIME1&lt;BR /&gt;echo $TIME2&lt;BR /&gt;&lt;BR /&gt;it is described in the man page for ksh.&lt;BR /&gt;&lt;BR /&gt;regards John</description>
      <pubDate>Tue, 18 Jun 2002 05:54:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/elapsed-time-in-a-script/m-p/2746608#M944479</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-06-18T05:54:50Z</dc:date>
    </item>
  </channel>
</rss>

