Commits (1)
...@@ -790,7 +790,7 @@ js_mswait(JSContext *cx, uintN argc, jsval *arglist) ...@@ -790,7 +790,7 @@ js_mswait(JSContext *cx, uintN argc, jsval *arglist)
{ {
jsval *argv=JS_ARGV(cx, arglist); jsval *argv=JS_ARGV(cx, arglist);
int32 val=1; int32 val=1;
clock_t start=msclock(); double start=xp_timer();
jsrefcount rc; jsrefcount rc;
if(argc) { if(argc) {
...@@ -801,7 +801,7 @@ js_mswait(JSContext *cx, uintN argc, jsval *arglist) ...@@ -801,7 +801,7 @@ js_mswait(JSContext *cx, uintN argc, jsval *arglist)
mswait(val); mswait(val);
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
JS_SET_RVAL(cx, arglist,UINT_TO_JSVAL(msclock()-start)); JS_SET_RVAL(cx, arglist,DOUBLE_TO_JSVAL((xp_timer()-start) * 1000));
return(JS_TRUE); return(JS_TRUE);
} }
......
...@@ -94,7 +94,7 @@ enum { ...@@ -94,7 +94,7 @@ enum {
,SYS_PROP_MODS_DIR ,SYS_PROP_MODS_DIR
,SYS_PROP_LOGS_DIR ,SYS_PROP_LOGS_DIR
/* msclock() access */ /* clock/timer access */
,SYS_PROP_CLOCK ,SYS_PROP_CLOCK
,SYS_PROP_CLOCK_PER_SEC ,SYS_PROP_CLOCK_PER_SEC
,SYS_PROP_TIMER ,SYS_PROP_TIMER
...@@ -312,10 +312,10 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp) ...@@ -312,10 +312,10 @@ static JSBool js_system_get(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
break; break;
case SYS_PROP_CLOCK: case SYS_PROP_CLOCK:
*vp=DOUBLE_TO_JSVAL((double)msclock()); *vp=DOUBLE_TO_JSVAL((double)xp_timer64());
break; break;
case SYS_PROP_CLOCK_PER_SEC: case SYS_PROP_CLOCK_PER_SEC:
*vp=UINT_TO_JSVAL(MSCLOCKS_PER_SEC); *vp=UINT_TO_JSVAL(1000);
break; break;
case SYS_PROP_TIMER: case SYS_PROP_TIMER:
*vp=DOUBLE_TO_JSVAL(xp_timer()); *vp=DOUBLE_TO_JSVAL(xp_timer());
......