Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add &times

  • Loading branch information...
commit f7b5a9c75e668832e51c543be41d0ceae1e2ba1f 1 parent 5c3490f
@sorear authored
Showing with 10 additions and 0 deletions.
  1. +9 −0 lib/Builtins.cs
  2. +1 −0  lib/CORE.setting
View
9 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;
@@ -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() {
View
1  lib/CORE.setting
@@ -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 term:« time »() { Q:CgOp { (bif_now) } }
sub term:« rand »() { Q:CgOp { (bif_rand) } }
Please sign in to comment.
Something went wrong with that request. Please try again.