http://fex.baidu.com/blog/2014/05/build-performance-monitor-in-7-days/
http://www.cnblogs.com/chuaWeb/p/PerformanceMonitoring.html
浏览器加载过程的四个关键性能指标:
白屏时间
用户从打开页面开始到页面开始有东西呈现为止,这过程中占用的时间就是白屏时间。
首屏时间
用户浏览器首屏内所有内容都呈现出来所花费的时间
优化:使用gzip,降低页面内容的传输时间、预渲染、预加载、页面模块懒加载、SSR(数据直出)、使用精灵图
用户可操作
用户可以进行正常的点击、输入等操作
总下载时间
页面所有资源都加载完成并呈现出来所花的时间,即页面 onload 的时间
以上时间还可以通过 Performance API 来计算
一元+运算符:
https://stackoverflow.com/questions/221539/what-does-the-plus-sign-do-in-new-date
https://stackoverflow.com/questions/14255664/new-date-is-this-good-practice
+ 相当于转为数字。
new xxx 等价于 new xxx() ;