タグ

ブックマーク / scriptsample.blog116.fc2.com (1)

  • ミリ秒を求める Script Source Sample for Perl

    Time::HiRes モジュールの関数を使う。$now にはエポックからの経過秒数がマイクロ単位で代入される。$seconds には整数秒、$microseconds には小数点以下の数値が代入される。 use Time::HiRes; $now = Time::HiRes::time; ($seconds, $microseconds) = Time::HiRes::gettimeofday; 経過時間を求めるには、Time::HiRes::time を2回実行して、単純に引き算する。 use Time::HiRes; $s_time = Time::HiRes::time; $e_time = Time::HiRes::time; $interval = $e_time - $s_time; print "Content-type:text/html\n\n"; printf "開始

    gologo13
    gologo13 2010/09/15
    ミリ秒単位で時間を求める time
  • 1