estimate-gcode-time.pl 426 B

123456789101112131415161718192021
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. BEGIN {
  5. use FindBin;
  6. use lib "$FindBin::Bin/../lib";
  7. use local::lib "$FindBin::Bin/../local-lib";
  8. }
  9. use Slic3r;
  10. die "Usage: estimate-gcode-time.pl FILE\n"
  11. if @ARGV != 1;
  12. my $estimator = Slic3r::GCode::TimeEstimator->new;
  13. $estimator->parse_file($ARGV[0]);
  14. printf "Time: %d minutes and %d seconds\n", int($estimator->time / 60), $estimator->time % 60;
  15. __END__