momentjstz

JavaScript performance comparison

Test case created and last updated

Preparation code

<script src="http://momentjs.com/downloads/moment-with-langs.js"></script>
<script src="http://momentjs.com/downloads/moment-timezone.js"></script>
<script>
moment.tz.add({
    "zones": {
        "America/Toronto": [
            "-5:17:32 - LMT 1895 -5:17:32",
            "-5 Canada E%sT 1919 -5",
            "-5 Toronto E%sT 1942_1_9_2 -5",
            "-5 Canada E%sT 1946 -5",
            "-5 Toronto E%sT 1974 -5",
            "-5 Canada E%sT"
        ]
    },
    "rules": {
        "Canada": [
            "1918 1918 3 14 7 2 0 1 D",
            "1918 1918 9 27 7 2 0 0 S",
            "1942 1942 1 9 7 2 0 1 W",
            "1945 1945 7 14 7 23 1 1 P",
            "1945 1945 8 30 7 2 0 0 S",
            "1974 1986 3 0 8 2 0 1 D",
            "1974 2006 9 0 8 2 0 0 S",
            "1987 2006 3 1 0 2 0 1 D",
            "2007 9999 2 8 0 2 0 1 D",
            "2007 9999 10 1 0 2 0 0 S"
        ],
        "Toronto": [
            "1919 1919 2 30 7 23:30 0 1 D",
            "1919 1919 9 26 7 0 0 0 S",
            "1920 1920 4 2 7 2 0 1 D",
            "1920 1920 8 26 7 0 0 0 S",
            "1921 1921 4 15 7 2 0 1 D",
            "1921 1921 8 15 7 2 0 0 S",
            "1922 1923 4 8 0 2 0 1 D",
            "1922 1926 8 15 0 2 0 0 S",
            "1924 1927 4 1 0 2 0 1 D",
            "1927 1932 8 0 8 2 0 0 S",
            "1928 1931 3 0 8 2 0 1 D",
            "1932 1932 4 1 7 2 0 1 D",
            "1933 1940 3 0 8 2 0 1 D",
            "1933 1933 9 1 7 2 0 0 S",
            "1934 1939 8 0 8 2 0 0 S",
            "1945 1946 8 0 8 2 0 0 S",
            "1946 1946 3 0 8 2 0 1 D",
            "1947 1949 3 0 8 0 0 1 D",
            "1947 1948 8 0 8 0 0 0 S",
            "1949 1949 10 0 8 0 0 0 S",
            "1950 1973 3 0 8 2 0 1 D",
            "1950 1950 10 0 8 2 0 0 S",
            "1951 1956 8 0 8 2 0 0 S",
            "1957 1973 9 0 8 2 0 0 S"
        ]
    },
    "links": {}
});
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Format without tz
moment().format();
pending…
Format with tz
moment().tz("America/Toronto").format();
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 comments

Add a comment