Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add &times
  • Loading branch information
sorear committed May 30, 2011
1 parent 5c3490f commit f7b5a9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Builtins.cs
@@ -1,6 +1,7 @@
using Niecza;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
Expand Down Expand Up @@ -917,6 +918,14 @@ class SubstrLValue: Variable {
return MakeFloat(((double)(t - 621355968000000000L)) / 10000000.0);
}

public static Variable bif_times() {
Process p = Process.GetCurrentProcess();
Variable[] ret = new Variable[4];
ret[0] = ret[2] = MakeFloat(((double)p.UserProcessorTime.Ticks) / 10000000.0);
ret[1] = ret[3] = MakeFloat(((double)p.PrivilegedProcessorTime.Ticks) / 10000000.0);
return MakeParcel(ret);
}

private static Random rng = new Random();

public static Variable bif_rand() {
Expand Down
1 change: 1 addition & 0 deletions lib/CORE.setting
Expand Up @@ -1381,6 +1381,7 @@ my class Instant {
sub term:« now »() {
Instant.new( val => Q:CgOp { (bif_now) } );
}
sub times() { Q:CgOp { (_cgop bif_times) } }
sub termtime »() { Q:CgOp { (bif_now) } }
sub term:« rand »() { Q:CgOp { (bif_rand) } }
Expand Down

0 comments on commit f7b5a9c

Please sign in to comment.