-
-
Save Timbus/1afd922304e3c1d1cb22 to your computer and use it in GitHub Desktop.
Frozen threads?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use GTK::Simple; | |
my GTK::Simple::App $app .= new(title => "Test"); | |
$app.set_content( | |
GTK::Simple::VBox.new( | |
my $input = GTK::Simple::Entry.new(), | |
my $output = GTK::Simple::Label.new(text => "ready"), | |
), | |
); | |
$input.changed.stable(1).tap: -> $more { | |
my $then = now; | |
say "Got $more.text()"; | |
#Waste some cycles here: | |
my $z = [+] (^500).map({ (^10_000).pick }).grep(*.is-prime); | |
#Thought it might because I was updating the label. But it wasn't. You can comment the next line out. | |
$output.text = ($z%100) ~ ('a'...'z').pick(6).join; | |
say "Took " ~ now - $then; | |
}; | |
$app.run; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment