/** * Returns the current time in milliseconds. */ public static long currentTimeMillis() { return ScriptHelper.evalLong("new Date().getTime()", null); }
public static long nanoTime() { return ScriptHelper.evalLong("now()*1000*1000;", null); }
public long getTime() { return ScriptHelper.evalLong("new Date().getTime()", this); } }
public long getTime() { return ScriptHelper.evalLong("this.nativeDate.getTime()", this); }
public static long parseLong(String string) throws NumberFormatException { ScriptHelper.put("l", string, null); return ScriptHelper.evalLong("parseInt(l)", null); }
/** * Returns the absolute value of a long value. */ public static long abs(long a) { ScriptHelper.put("a", a, null); return ScriptHelper.evalLong("Math.abs(a)", null); }
/** * Returns the smaller of two long values. */ public static long min(long a, long b) { ScriptHelper.put("a", a, null); ScriptHelper.put("b", b, null); return ScriptHelper.evalLong("Math.min(a, b)", null); }
/** * Returns the greater of two long values. */ public static long max(long a, long b) { ScriptHelper.put("a", a, null); ScriptHelper.put("b", b, null); return ScriptHelper.evalLong("Math.max(a, b)", null); }
public long requestAnimationFrame(Runnable aRunnable) { Runnable runnableForDebugging= wrapRunnableForDebugging(aRunnable); ScriptHelper.put("ra", runnableForDebugging, this); return ScriptHelper.evalLong("requestAnimationFrame(function(time) {ra.$run$void();})", this); }
return (T) new Double(ScriptHelper.evalDouble("instance", callerInstance)); else if (type.equals(Long.class)) return (T) new Long(ScriptHelper.evalLong("instance", callerInstance)); else if (type.equals(Boolean.class)) return (T) new Boolean(ScriptHelper.evalBoolean("instance", callerInstance));