Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JsValueRef __stdcall WScriptJsrt::MonotonicNowCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
- {
- HRESULT hr = E_FAIL;
- JsValueRef returnValue = JS_INVALID_REFERENCE;
- JsErrorCode errorCode = JsNoError;
- IfJsrtErrorSetGo(ChakraRTInterface::JsGetUndefinedValue(&returnValue));
- using std::chrono::duration_cast;
- using std::chrono::milliseconds;
- using std::chrono::steady_clock;
- double now = duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count();
- ChakraRTInterface::JsNumberToDouble(now, &returnValue);
- return returnValue;
- Error:
- return returnValue;
- }
Add Comment
Please, Sign In to add comment