From db4c329aff4621e05b92a55be4f18173f5a4f655 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 17 Apr 2014 21:49:07 -0500 Subject: All: perf test, Makefile refactor, add *host-language* Other: - bash,make,postscript: quasiquote of vectors - Fix Java slurp - add time function to core.mal - switches on *host-language* for make time-secs vs time-ms - Ignore */experiments directories --- php/core.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'php/core.php') diff --git a/php/core.php b/php/core.php index 39a22ac..4cb4667 100644 --- a/php/core.php +++ b/php/core.php @@ -37,6 +37,12 @@ function println() { } +// Number functions +function time_ms() { + return intval(microtime(1) * 1000); +} + + // Hash Map functions function assoc($src_hm) { $args = func_get_args(); @@ -188,6 +194,7 @@ $core_ns = array( '-'=> function ($a, $b) { return intval($a - $b,10); }, '*'=> function ($a, $b) { return intval($a * $b,10); }, '/'=> function ($a, $b) { return intval($a / $b,10); }, + 'time-ms'=>function () { return time_ms(); }, 'list'=> function () { return call_user_func_array('_list', func_get_args()); }, 'list?'=> function ($a) { return _list_Q($a); }, -- cgit v1.2.3