summaryrefslogtreecommitdiff
path: root/platform/javascript/js
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-02-15 15:48:06 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-02-17 13:03:52 +0100
commit26ec6ca576ec91fe3ae52bd647d7d1778ad4716c (patch)
tree0b5fb068245a91d59a161eeabb55357a782ad1cc /platform/javascript/js
parent1446cfd13dae0e2e938466eddd325d45e1a032b5 (diff)
[HTML5] Implement get_processor_count.
Diffstat (limited to 'platform/javascript/js')
-rw-r--r--platform/javascript/js/libs/library_godot_os.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/javascript/js/libs/library_godot_os.js b/platform/javascript/js/libs/library_godot_os.js
index 9fde4a84e1..3ffcd655b7 100644
--- a/platform/javascript/js/libs/library_godot_os.js
+++ b/platform/javascript/js/libs/library_godot_os.js
@@ -282,6 +282,11 @@ const GodotOS = {
godot_js_os_shell_open: function (p_uri) {
window.open(GodotRuntime.parseString(p_uri), '_blank');
},
+
+ godot_js_os_hw_concurrency_get__sig: 'i',
+ godot_js_os_hw_concurrency_get: function () {
+ return navigator.hardwareConcurrency || 1;
+ },
};
autoAddDeps(GodotOS, '$GodotOS');