isDoubleByte

Benchmark created by isDoubleByte on


Preparation HTML

<script>
function isDoubleByte_charCodeAt(str) {
    for (var i = 0, n = str.length; i < n; i++) {
        if (str.charCodeAt(i) > 255) {
            return true;
        }
    }
    return false;
}


var regExp = /[^\\u0000-\\u00ff]/;
function isDoubleByte_regExp(str) {
    return regExp.test(str);
}

</script>

Test runner

Ready to run.

Testing in
TestOps/sec
isDoubleByte_charCodeAt
isDoubleByte_charCodeAt('✓ à la mode');
isDoubleByte_charCodeAt('ascii');
ready
isDoubleByte_regExp
isDoubleByte_regExp('✓ à la mode');
isDoubleByte_regExp('ascii');
ready

Revisions

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

  • Revision 1: published by isDoubleByte on