#!/usr/bin/perl
use warnings;
use strict;
use Gtk2 -init;
use Time::HiRes qw( time );
my $time_start = time;
my $s = Gtk2::Gdk::Screen->get_default;
my $w = $s->get_root_window;
# pixbuf = $pixbuf->get_from_drawable ($src, $cmap, $src_x, $src_y,
# $dest_x, $dest_y, $width, $height
+)
while (1){
my $p = Gtk2::Gdk::Pixbuf->get_from_drawable (
$w, undef, 0, 0, 0, 0, $s->get_width, $s->get_height);
$p->save (time.'.png', "png");
}
my $time_end = time;
my $diff = $time_end - $time_start;
print "$diff\n";
|