From c4e417d6de34422f9fd7d03a4dd57bb4813d0f3e Mon Sep 17 00:00:00 2001 From: Paul Bone Date: Tue, 24 May 2016 16:29:39 +1000 Subject: [PATCH] Uncomment foreign code definition for clock/3. I noticed this code commented out in time.m, I guessed it'd be straightforward to make work and it seems to be working on mono. I cannot test it on .NET though. library/time.m: As above. --- library/time.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/time.m b/library/time.m index bf4caadfd..ea9c569cb 100644 --- a/library/time.m +++ b/library/time.m @@ -264,16 +264,14 @@ time.clock(Result, !IO) :- " Ret = (MR_Integer) clock(); "). -/* XXX need to add System.dll to the references list. :- pragma foreign_proc("C#", time.c_clock(Ret::out, _IO0::di, _IO::uo), [will_not_call_mercury, promise_pure, tabled_for_io], "{ // XXX Ticks is long in .NET! - Ret = (int) System.Diagnostics.Process.GetCurrentProcess - .UserProcessorTime.Ticks; + Ret = (int) System.Diagnostics.Process.GetCurrentProcess(). + UserProcessorTime.Ticks; }"). -*/ :- pragma foreign_proc("Java", time.c_clock(Ret::out, _IO0::di, _IO::uo), [will_not_call_mercury, promise_pure, tabled_for_io],