Improve performance of microtick
This commit is contained in:
parent
d505d7b936
commit
f7bac07b10
|
@ -146,7 +146,7 @@ function V86Starter(options)
|
|||
"_todo": function() { return cpu.todo.apply(cpu, arguments); },
|
||||
"_undefined_instruction": function() { return cpu.undefined_instruction.apply(cpu, arguments); },
|
||||
"_unimplemented_sse": function() { return cpu.unimplemented_sse(); },
|
||||
"_microtick": function() { return v86.microtick(); },
|
||||
"_microtick": v86.microtick,
|
||||
"_get_rand_int": function() { return v86util.get_rand_int(); },
|
||||
"_has_rand_int": function() { return v86util.has_rand_int(); },
|
||||
"_printf": function(format_string_offset, stack_top) {
|
||||
|
|
|
@ -177,10 +177,7 @@ v86.prototype.restore_state = function(state)
|
|||
|
||||
if(typeof performance === "object" && performance.now)
|
||||
{
|
||||
v86.microtick = function()
|
||||
{
|
||||
return performance.now();
|
||||
};
|
||||
v86.microtick = performance.now.bind(performance);
|
||||
}
|
||||
//else if(typeof process === "object" && process.hrtime)
|
||||
//{
|
||||
|
|
Loading…
Reference in a new issue