Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bun.js/bindings/ZigGlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ JSC_DEFINE_HOST_FUNCTION(functionPerformanceNow, (JSGlobalObject * globalObject,
auto* global = reinterpret_cast<GlobalObject*>(globalObject);
// nanoseconds to seconds
uint64_t time = Bun__readOriginTimer(global->bunVM());
double result = time / 1000000000.0;
double result = time / 1000000000000000.0;
return JSValue::encode(jsNumber(time));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are still returning the time variable. Please calculate double result = time / 1000000.0; and change jsNumber(time) to jsNumber(result)

@Pruxis Pruxis Jul 8, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overlooked that, the added 0's are incorrect and should be time / 1_000_000.0 I suppose

}

Expand Down