Skip to content

Instantly share code, notes, and snippets.

@jonathanstowe
Created March 6, 2016 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanstowe/23a9bb99630fef8c8588 to your computer and use it in GitHub Desktop.
Save jonathanstowe/23a9bb99630fef8c8588 to your computer and use it in GitHub Desktop.
use NativeCall;
class Timeval is repr('CStruct') {
has int64 $.seconds;
has int64 $.microseconds;
}
sub select(int64, Pointer, Pointer, Pointer, Timeval) is native { * }
my $tv = Timeval.new(seconds => 10, microseconds => 0);
Supply.interval(1).tap({ say $_});
select(1,Pointer, Pointer, Pointer, $tv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment