当前位置:网站首页>White screen time, first screen time
White screen time, first screen time
2022-06-11 10:39:00 【Front end students】
White screen time
The time when the browser displays the first character or element 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> hang </title>
<script type="text/javascript">
// Are not compatible performance.timing Browser , Such as IE8
window.pageStartTime = Date.now();
</script>
<!-- page CSS resources -->
<link rel="stylesheet" href="common.css">
<link rel="stylesheet" href="page.css">
<script type="text/javascript">
// White screen time end point
window.firstPaint = Date.now();
</script>
</head>
<body>
<!-- The page content -->
</body>
</html>
You can use Performance API when
White screen time = firstPaint - performance.timing.navigationStart;
You can use Performance API when
White screen time = firstPaint - pageStartTime;
First screen time
The first screen time is when the user opens the website , The time until the first screen of the browser is rendered ,dom At a relatively stable stage .
For the user experience , The first screen time is an important factor for users to experience a website . Usually a website , If the first screen time is 5 Seconds or less is excellent ,10 Within seconds is acceptable ,10 Seconds or more is intolerable . exceed 10 Seconds of the first screen time, the user will choose to refresh the page or leave immediately .
stay SSR( Server rendering ) The application of , We think html Of body The rendering time is the first screen time . We usually use W3C The standard Performance Object to calculate the first screen time .
Performance Often used to collect performance data , Because the object has built-in performance parameters for almost all common front ends .
But as the Vue and React And so on, the front-end box prevails , Lead to Performance Unable to accurately monitor the first screen time of the page . Because the page body It's empty , The browser needs to load js, And then through js To render the content of the page . So what data do we use as the first screen time ?
In a word , Namely SSR Use Dom When the rendering ends ,SPA Project use FMP Time for .
边栏推荐
- 使用 Ribbon 实现客户端负载均衡
- 金仓数据库KingbaseES中的PL/SQL 编译检查
- 微信云开发Al短视频一键换脸小程序源码
- Habitable planet
- MySQL下载安装使用-完整详细步骤
- Cadence OrCAD capture design method to avoid misoperation graphic tutorial
- 网上开户是安全的吗?普通人可以开吗?
- 详解2.5G/5G/10G Base-T以太网接口物理层一致性测试!
- Some understanding of inductive bias
- C # introductory series (11) -- multidimensional array
猜你喜欢

校园失物招领小程序源码可作毕业设计

基于C语言实现比赛评分系统

微信云开发Al短视频一键换脸小程序源码

TikTok在英国遭遇文化冲突,短期内众多员工离职

Global pooling – pytoch

Arbitrum 基础架构:快速入门

MXNet对AlexNet模型的构建与实现(与LeNet的对比)

When installing mysql, an error occurred because msvcr120 could not be found DLL, unable to continue code resolution "

Arbitrum infrastructure: a quick start

pyspark案例系列4-dataframe输出到单个文件夹的解决方案
随机推荐
[audio and video] Introduction to SEI
[machine learning theory] true positive, true negative, false positive, false negative concept
Record yesterday's embarrassment
Use bat to write to the first line of the file
Ngui, backpack drag and drop, and random cloning of picture knowledge points
地铁路线图云开发小程序源码和配置教程
远程监控项目离线日志说明书
Batch add noise to data and generate new named annotation files
Pyspark case series 4-dataframe output to a single folder solution
电子设备辐射EMC整改案例
Ngui, floating blood
Pyramidtnt: TNT with characteristic pyramid structure
TikTok在英国遭遇文化冲突,短期内众多员工离职
【K-Means】K-Means学习实例
白屏时间、首屏时间
Fix the problem that uicollectionview does not reach the bottom security zone
Source code of digital collection app system
网上开户是安全的吗?普通人可以开吗?
详解2.5G/5G/10G Base-T以太网接口物理层一致性测试!
6.如何自动生成头文件依赖 -M