POV-Ray : Newsgroups : povray.unix : a little perl utility Server Time
23 Dec 2024 04:41:21 EST (-0500)
  a little perl utility (Message 1 to 1 of 1)  
From: Bill Hails
Subject: a little perl utility
Date: 7 Nov 2003 16:07:11
Message: <3fac097f@news.povray.org>
I knocked this up while I was waiting for a long render to finish
It estimates how long your render is likely to take based on how it's
gone so far. I call it "eta" on my box.

I'm not sure if I can post an attachment here so I'll just inline it. Hope 
somebody might find it useful.


#! /usr/bin/perl

$0 =~ s#.*/##;

if ("@ARGV" =~ /^(\d+):(\d\d):\d\d Rendering line (\d+) of (\d+)/) {
    my ($h, $m, $ldone, $tlines) = ($1, $2, $3, $4, $5);
    my $tdone = $h * 60 + $m;

    my $total = $tdone * $tlines / $ldone;
    my $remaining = $total - $tdone;

    ptime('total', $total);
    ptime('remaining', $remaining);
} else {
    die "cut'n'paste the current povray status as argument\n",
        "i.e. $0 37:13:20 Rendering line  787 of 1440 supersa..\n";
}

sub ptime {
    my ($txt, $mins) = @_;
    my $hours = int($mins / 60);
    $mins %= 60;
    printf("$txt: %d:%02d\n", $hours, $mins);
}


-- 
Bill Hails


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.