mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 09:53:36 +00:00
Implement some library procedures for the Java back-end.
Estimated hours taken: 2 Branches: main Implement some library procedures for the Java back-end. library/time.m: Implement c_clk_tck/0 for Java. Also changed the C implementation to use the same macro as that used in Native.c. java/runtime/Native.java.in: Add new function clk_tck() to be called by c_clk_tck/0. java/runtime/Native.c: Add corresponding implementation for clk_tck().
This commit is contained in:
@@ -128,6 +128,15 @@ public class Native {
|
||||
*/
|
||||
public static native int[] times();
|
||||
|
||||
/*
|
||||
** clk_tck():
|
||||
** Returns the number of "clock ticks" per second as defined by
|
||||
** sysconf(_SC_CLK_TCK). A `clock_t' value returned by
|
||||
** 'times()' can be divided by this value to obtain a time in
|
||||
** seconds.
|
||||
*/
|
||||
public static native int clk_tck();
|
||||
|
||||
/*
|
||||
** get_user_cpu_miliseconds():
|
||||
** Native method to return the CPU time consumed by the process,
|
||||
|
||||
Reference in New Issue
Block a user