• 阶级理论已经过时了,现在所有的国家都是发展生产力。发展是硬道理,科学技术是第一生产力,都是解决社会需求不平衡,不充分的矛盾的, 2019-12-10
  • 回复@老老保老张工:那咋分配呢? 2019-11-17
  • 工信部:鼓励婴幼儿配方乳企质量安全追溯体系建设 2019-11-17
  • 第527期:过年该送健康礼,几点秘籍教给你 2019-11-11
  • 竹编:缝隙里的乡愁文章中国国家地理网 2019-11-11
  • 感触名家笔下的端午文化 吃香粽原来可以这样"文艺" 2019-11-06
  • 人民日报召开习近平新闻思想理论研讨会 2019-10-31
  • 鹏城展翅再高飞(壮阔东方潮 奋进新时代——庆祝改革开放40年) 2019-10-31
  • 财经 —频道 春城壹网 七彩云南 一网天下 2019-10-16
  • 酒后躺车内休息也属于酒驾? 交巡警告诉你这些行为都是酒驾 2019-10-09
  • 新疆阿拉山口口岸严防有害生物入境 2019-10-09
  • 香港多地举办龙舟赛共庆端午节 2019-10-02
  • 河北一保时捷车主疑遭枪击 警方悬赏9万元通缉 2019-10-02
  • 【理上网来·喜迎十九大】党的强军思想指引强军事业 2019-09-24
  • 聚焦机构改革:新部门接连挂牌 快速进入角色 2019-09-11
  • 麻将游戏胜利界面

    麻将游戏单机闯关:High Resolution Time

    W3C Recommendation 17 December 2012

    This version:
    //www.vfdks.tw/TR/2012/REC-hr-time-20121217/
    Latest version:
    //www.vfdks.tw/TR/hr-time/
    Latest Level 1 version:
    //www.vfdks.tw/TR/hr-time-1/
    Previous Version:
    //www.vfdks.tw/TR/2012/PR-hr-time-20121023/
    Editor:
    Jatinder Mann, Microsoft Corp., <>

    Please refer to the errata for this document, which may include some normative corrections.

    See also translations.


    NOTE: This specification is outdated and currently not maintained. The Web Performance Working Group encourages authors and implementors to use High Resolution Time Level 2 (or its successor) instead of this document.

    Abstract

    This specification defines a JavaScript interface that provides the current time in sub-millisecond resolution and such that it is not subject to system clock skew or adjustments.

    Status of this document

    This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at //www.vfdks.tw/TR/.

    This is the W3C Recommendation for "High Resolution Time Specification". An implementation report, produced during the Candidate Recommendation phase in 2012, is available based on the High Resolution Time test suite.

    Please send comments to [email protected] (archived) with [HighResolutionTime] at the start of the subject line.

    No changes were done to this specification during the Proposed Recommendation period.

    This document is produced by the Web Performance Working Group.

    This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

    This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

    Table of Contents

    1. 1 Introduction
    2. 2 Conformance requirements
    3. 3 Terminology
    4. 4 High Resolution Time
      1. 4.1 Introduction
      2. 4.2 The DOMHighResTimeStamp Type
      3. 4.3 Extensions to the Performance interface
      4. 4.4 Monotonic Clock
      5. 4.5 Privacy and Security
    5. 5 References
    6. Acknowledgements

    1 Introduction

    This section is non-normative.

    The ECMAScript Language Specification defines the Date object as a time value representing time in milliseconds since 01 January, 1970 UTC. For most purposes, this definition of time is sufficient as these values represent time to millisecond precision for any instant that is within approximately 285,616 years from 01 January, 1970 UTC. The DOMTimeStamp is defined similarly.

    In practice, these definitions of time are subject to both clock skew and adjustment of the system clock. The value of time may not always be monotonically increasing and subsequent values may either decrease or remain the same.

    For example, the following script may log a positive number, negative number, or zero.
    var mark_start = Date.now();
    doTask(); // Some task
    if (window.console) window.console.log('Duration of task: ' + (Date.now() - mark_start));
    	

    For certain tasks this definition of time may not be sufficient as it does not allow for sub-millisecond resolution and is subject to system clock skew. For example,

    This specification does not propose changing the behavior of Date.now() as it is genuinely useful in determining the current value of the calendar time and has a long history of usage. The DOMHighResTimeStamp type and the now method of the Performance interface resolve the issues summarized in this section by providing a monotonically increasing time value in sub-millisecond resolution.

    2 Conformance requirements

    All diagrams, examples, and notes in this specification are non-normative, as are all sections explicitly marked non-normative. Everything else in this specification is normative.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this document are to be interpreted as described in RFC 2119. For readability, these words do not appear in all uppercase letters in this specification.

    Some conformance requirements are phrased as requirements on attributes, methods or objects. Such requirements are to be interpreted as requirements on user agents.

    The IDL fragments in this specification must be interpreted as required for conforming IDL fragments, as described in the Web IDL specification. [Web IDL]

    3 Terminology

    The construction "a Foo object", where Foo is actually an interface, is sometimes used instead of the more accurate "an object implementing the interface Foo".

    The term "JavaScript" is used to refer to ECMA-262, rather than the official term ECMAScript, since the term JavaScript is more widely known.

    4 High Resolution Time

    4.1 Introduction

    This section is non-normative.

    This specification defines an interface that provides the current time in sub-millisecond resolution and such that it is not subject to system clock skew or adjustments.

    4.2 The DOMHighResTimeStamp Type

    The DOMHighResTimeStamp type is used to store a time value measured relative to the navigationStart attribute of the PerformanceTiming interface [NavigationTiming], the start of navigation of the document, or a time value that represents a duration between two DOMHighResTimeStamps.

    Type Definition DOMHighResTimeStamp

    A DOMHighResTimeStamp SHOULD represent a number of milliseconds accurate to a thousandth of a millisecond.

    Note

    If the User Agent is unable to provide a time value accurate to a thousandth of a millisecond due to hardware or software constraints, the User Agent can represent a DOMHighResTimeStamp as a number of milliseconds accurate to a millisecond.


    IDL Definition
    typedef double DOMHighResTimeStamp;
    				

    4.3 Extensions to the Performance interface

    partial interface Performance {
      DOMHighResTimeStamp now();
    };
    

    now method

    The now method MUST return a DOMHighResTimeStamp representing the number of milliseconds from the navigationStart attribute of the PerformanceTiming interface [NavigationTiming], the start of navigation of the document, to the occurrence of the call to the now method.

    Note

    As the now method returns the current time, time spent while a document is hidden [Page Visibility] or not fully active [HTML5] is included for the purpose of this method.

    4.4 Monotonic Clock

    The time values returned when calling the now method MUST be monotonically increasing and not subject to system clock adjustments or system clock skew. The difference between any two chronologically recorded time values returned from the now method MUST never be negative.

    4.5 Privacy and Security

    Statistical fingerprinting is a privacy concern where a malicious web site may determine whether a user has visited a third-party web site by measuring the timing of cache hits and misses of resources in the third-party web site. Though the now method of the Performance interface returns time data to a greater accuracy than before, it does not make this privacy concern significantly worse than it was already.

    5 References

    5.1 Normative References

    [IETF RFC 2119]
    Key words for use in RFCs to Indicate Requirement Levels, Scott Bradner, Author. Internet Engineering Task Force, March 1997. Available at //www.ietf.org/rfc/rfc2119.txt.
    [ECMA-262]
    ECMAScript Language Specification, 5.1 Edition. ECMA International, Standard ECMA-262, June 2011. This version of the ECMAScript Language is available from //www.ecma-international.org/publications/standards/Ecma-262.htm.
    Navigation Timing, Zhiheng Wang, Editor. World Wide Web Consortium, December 2012. This version of the Navigation Timing Recommendation is available from //www.vfdks.tw/TR/2012/REC-navigation-timing-20121217/. The latest version of Navigation Timing is available at //www.vfdks.tw/TR/navigation-timing/.
    [Web IDL]
    Web IDL, Cameron McCormack, Editor. World Wide Web Consortium, April 2012. This version of the Web IDL specification is available from //www.vfdks.tw/TR/2012/CR-WebIDL-20120419/. The latest version of Web IDL is available at //www.vfdks.tw/TR/WebIDL/.

    5.2 Informative References

    [HTML5]
    HTML5, Robin Berjon et al., Editors. World Wide Web Consortium, December 2012. This version of the HTML5 is available from //www.vfdks.tw/TR/html5/. The 麻将游戏胜利界面 of HTML5 is available at //www.vfdks.tw/html/wg/drafts/html/CR/.
    [Page Visibility]
    Page Visibility, Jatinder Mann and Arvind Jain, Editors. World Wide Web Consortium, July 2012. This version of the Page Visibility specification is available from //www.vfdks.tw/TR/2012/CR-page-visibility-20120726/. The latest version of Page Visibility is available at //www.vfdks.tw/TR/page-visibility/.

    Acknowledgements

    I would like to sincerely thank Karen Anderson, Nat Duca, Tony Gentilcore, Arvind Jain, James Robinson, James Simonsen, and Jason Weber to acknowledge their contributions to this work.

  • 阶级理论已经过时了,现在所有的国家都是发展生产力。发展是硬道理,科学技术是第一生产力,都是解决社会需求不平衡,不充分的矛盾的, 2019-12-10
  • 回复@老老保老张工:那咋分配呢? 2019-11-17
  • 工信部:鼓励婴幼儿配方乳企质量安全追溯体系建设 2019-11-17
  • 第527期:过年该送健康礼,几点秘籍教给你 2019-11-11
  • 竹编:缝隙里的乡愁文章中国国家地理网 2019-11-11
  • 感触名家笔下的端午文化 吃香粽原来可以这样"文艺" 2019-11-06
  • 人民日报召开习近平新闻思想理论研讨会 2019-10-31
  • 鹏城展翅再高飞(壮阔东方潮 奋进新时代——庆祝改革开放40年) 2019-10-31
  • 财经 —频道 春城壹网 七彩云南 一网天下 2019-10-16
  • 酒后躺车内休息也属于酒驾? 交巡警告诉你这些行为都是酒驾 2019-10-09
  • 新疆阿拉山口口岸严防有害生物入境 2019-10-09
  • 香港多地举办龙舟赛共庆端午节 2019-10-02
  • 河北一保时捷车主疑遭枪击 警方悬赏9万元通缉 2019-10-02
  • 【理上网来·喜迎十九大】党的强军思想指引强军事业 2019-09-24
  • 聚焦机构改革:新部门接连挂牌 快速进入角色 2019-09-11
  • 广东好彩1在哪里买 网球吧猩 捕鱼达人iphone版 浙江快乐12走势 极速快3群 北京十一选五选号技巧 四肖中特期期准免费准 福彩七乐彩开奖结果 湖北十一选五助手免费版 贷款公司的业务员靠什么赚钱吗