Merge pull request #2626 from rtfeldman/gen-dev/quicksort2

Gen dev - Quicksort
This commit is contained in:
Brian Carroll 2022-03-07 17:46:46 +00:00 committed by GitHub
commit 92ace8ff67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1181 additions and 247 deletions

View file

@ -61,15 +61,15 @@ pub export fn main() i32 {
// actually call roc to populate the callresult
const callresult = roc__mainForHost_1_exposed();
// end time
var ts2: std.os.timespec = undefined;
std.os.clock_gettime(std.os.CLOCK_REALTIME, &ts2) catch unreachable;
// stdout the result
stdout.print("{s}\n", .{callresult.asSlice()}) catch unreachable;
callresult.deinit();
// end time
var ts2: std.os.timespec = undefined;
std.os.clock_gettime(std.os.CLOCK_REALTIME, &ts2) catch unreachable;
const delta = to_seconds(ts2) - to_seconds(ts1);
stderr.print("runtime: {d:.3}ms\n", .{delta * 1000}) catch unreachable;

View file

@ -60,15 +60,15 @@ pub export fn main() i32 {
// actually call roc to populate the callresult
const callresult = roc__mainForHost_1_exposed();
// end time
var ts2: std.os.timespec = undefined;
std.os.clock_gettime(std.os.CLOCK_REALTIME, &ts2) catch unreachable;
// stdout the result
stdout.print("{s}\n", .{callresult.asSlice()}) catch unreachable;
callresult.deinit();
// end time
var ts2: std.os.timespec = undefined;
std.os.clock_gettime(std.os.CLOCK_REALTIME, &ts2) catch unreachable;
const delta = to_seconds(ts2) - to_seconds(ts1);
stderr.print("runtime: {d:.3}ms\n", .{delta * 1000}) catch unreachable;