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.
This commit is contained in:
Paul Bone
2016-05-24 16:29:39 +10:00
parent 5647037b63
commit c4e417d6de

View File

@@ -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],