Skip to content

Instantly share code, notes, and snippets.

@manekinekko
Created October 3, 2023 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manekinekko/4a9555f99106d9e575d0094ff8620b8c to your computer and use it in GitHub Desktop.
Save manekinekko/4a9555f99106d9e575d0094ff8620b8c to your computer and use it in GitHub Desktop.
Untitled benchmark (http://jsbench.github.io/#4a9555f99106d9e575d0094ff8620b8c) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Untitled benchmark</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
<h2><code>cmd + alt + j</code> or <code>ctrl + alt + j</code></h2>
</body>
</html>
"use strict";
(function (factory) {
if (typeof Benchmark !== "undefined") {
factory(Benchmark);
} else {
factory(require("benchmark"));
}
})(function (Benchmark) {
var suite = new Benchmark.Suite;
suite.add("var text = `To cancel a confirmed booking, follow these steps:", function () {
var text = `To cancel a confirmed booking, follow these steps:
1. Log in to your Contoso Real Estate account. [support.md]
2. Click on your profile picture and navigate to "Bookings". [support.md]
3. Find the booking you want to cancel and click on it. [support.md]
4. Click on the "Cancel Reservation" button. [support.md]
5. Review the cancellation policy to understand any potential fees. [support.md]
6. Confirm the cancellation. [support.md]
7. Depending on the host's cancellation policy, you may be subject to cancellation fees. These fees will be clearly displayed during the cancellation process. [support.md]
8. If eligible for a refund, it will be processed according to the cancellation policy. [support.md]
Next Questions:
1. How can I contact customer support?
2. What are the cancellation fees?
3. <<How long does it take to receive a refund after cancellation?>>`
text.includes('>>')
});
suite.on("cycle", function (evt) {
console.log(" - " + evt.target);
});
suite.on("complete", function (evt) {
console.log(new Array(30).join("-"));
var results = evt.currentTarget.sort(function (a, b) {
return b.hz - a.hz;
});
results.forEach(function (item) {
console.log((idx + 1) + ". " + item);
});
});
console.log("Untitled benchmark");
console.log(new Array(30).join("-"));
suite.run();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment