-
-
Notifications
You must be signed in to change notification settings - Fork 34k
tls: pass in Timer.now() value straight from C++ #18562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,13 +12,16 @@ namespace node { | |
| using v8::Context; | ||
| using v8::FunctionTemplate; | ||
| using v8::HandleScope; | ||
| using v8::Integer; | ||
| using v8::Isolate; | ||
| using v8::Local; | ||
| using v8::Message; | ||
| using v8::Number; | ||
| using v8::Private; | ||
| using v8::StackFrame; | ||
| using v8::StackTrace; | ||
| using v8::String; | ||
| using v8::Value; | ||
|
|
||
| IsolateData::IsolateData(Isolate* isolate, | ||
| uv_loop_t* event_loop, | ||
|
|
@@ -341,6 +344,18 @@ void Environment::ToggleImmediateRef(bool ref) { | |
| } | ||
|
|
||
|
|
||
| Local<Value> Environment::GetNow() { | ||
| uv_update_time(event_loop()); | ||
| uint64_t now = uv_now(event_loop()); | ||
| CHECK(now >= timer_base()); | ||
| now -= timer_base(); | ||
| if (now <= 0xfffffff) | ||
|
||
| return Integer::New(isolate(), static_cast<uint32_t>(now)); | ||
| else | ||
| return Number::New(isolate(), static_cast<double>(now)); | ||
| } | ||
|
||
|
|
||
|
|
||
| void CollectExceptionInfo(Environment* env, | ||
| v8::Local<v8::Object> obj, | ||
| int errorno, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CHECK_GE
(Sorry, probably forgot to mention that last time.)