async function iKonwYouVisitedTheWebsite(resourceSrc){
function getLoadTime(){
return new Promise(r=>{
const script = document.createElement('script')
const start = Date.now()
script.onload = () => {
document.body.removeChild(script)
r(Date.now() - start)
}
script.src = resourceSrc
document.body.appendChild(script)
})
}
const t1 = await getLoadTime()
const t2 = await getLoadTime()
return t1 - t2
}
iKonwYouVisitedTheWebsite('https://static.zhihu.com/heifetz/main.app.a662d8a4162fcbc4916e.js').then(t=>{
document.write(t>250 ? `您没上过知乎:${t}` : `您上过知乎:${t}`)
})
console