mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
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:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user