Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Dependency Status

Split executing of javascript code into slice

Normal Javascript

importslicePerform,{_clock}from'../lib/index'constCOUNT=10000000letbegin=_clock()for(varindex=0;index<COUNT;index++);letduration=_clock()-beginconsole.log(index,`${duration/1000000000}s`)

Slice Javascript

constslicePerform=require('slice-perform')constCOUNT=10000000letindex=0slicePerform(90,// sliceTimeInMS10,// waitTimeInMS, in wait time, ui thread will not be blocked by javascript()=>index<COUNT,// test()=>index+=1,// fn(duration)=>console.log(index,`${duration/1000000000}s`)// callback)

About

Split the executing of javascript code, make the browser ui thread free

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages