Skip to content

Instantly share code, notes, and snippets.

@perlpilot
Created July 1, 2015 21: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 perlpilot/6ad78bada61335115510 to your computer and use it in GitHub Desktop.
Save perlpilot/6ad78bada61335115510 to your computer and use it in GitHub Desktop.
use NativeCall;
constant clock_t = int64;
class tms is repr('CStruct') {
has clock_t $.user-time;
has clock_t $.system-time;
has clock_t $.children-user-time;
has clock_t $.children-system-cstime;
}
my sub _times(tms) returns clock_t
is symbol('times')
is native {*}
sub times() {
my tms $buf .= new;
_times($buf);
return $buf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment