summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2023-12-27 19:09:29 +0100
committerFabrice Bellard <fabrice@bellard.org>2023-12-27 19:09:29 +0100
commit2ee6be705fde0eb68acec25915d2947de1207abb (patch)
tree05bb2acdbf538dad3603fc3bd1bbed377ac1fd50 /quickjs.c
parentffe81419fff5798b1983e30702c66d9ceb1f8a7a (diff)
downloadquickjs-2ee6be705fde0eb68acec25915d2947de1207abb.tar.gz
quickjs-2ee6be705fde0eb68acec25915d2947de1207abb.zip
added os.now()
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/quickjs.c b/quickjs.c
index a95340d..719fde1 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -42791,30 +42791,6 @@ static const JSCFunctionListEntry js_math_obj[] = {
/* Date */
-#if 0
-/* OS dependent: return the UTC time in ms since 1970. */
-static JSValue js___date_now(JSContext *ctx, JSValueConst this_val,
- int argc, JSValueConst *argv)
-{
- int64_t d;
- struct timeval tv;
- gettimeofday(&tv, NULL);
- d = (int64_t)tv.tv_sec * 1000 + (tv.tv_usec / 1000);
- return JS_NewInt64(ctx, d);
-}
-#endif
-
-/* OS dependent: return the UTC time in microseconds since 1970. */
-static JSValue js___date_clock(JSContext *ctx, JSValueConst this_val,
- int argc, JSValueConst *argv)
-{
- int64_t d;
- struct timeval tv;
- gettimeofday(&tv, NULL);
- d = (int64_t)tv.tv_sec * 1000000 + tv.tv_usec;
- return JS_NewInt64(ctx, d);
-}
-
/* OS dependent. d = argv[0] is in ms from 1970. Return the difference
between UTC time and local time 'd' in minutes */
static int getTimezoneOffset(int64_t time) {
@@ -48899,12 +48875,6 @@ static const JSCFunctionListEntry js_global_funcs[] = {
JS_PROP_DOUBLE_DEF("Infinity", 1.0 / 0.0, 0 ),
JS_PROP_DOUBLE_DEF("NaN", NAN, 0 ),
JS_PROP_UNDEFINED_DEF("undefined", 0 ),
-
- /* for the 'Date' implementation */
- JS_CFUNC_DEF("__date_clock", 0, js___date_clock ),
- //JS_CFUNC_DEF("__date_now", 0, js___date_now ),
- //JS_CFUNC_DEF("__date_getTimezoneOffset", 1, js___date_getTimezoneOffset ),
- //JS_CFUNC_DEF("__date_create", 3, js___date_create ),
};
/* Date */