init
This commit is contained in:
commit
c1ff9ee63e
12 changed files with 499 additions and 0 deletions
32
example/simple.ts
Executable file
32
example/simple.ts
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env -S deno run -A --unstable-temporal
|
||||
Deno.env.set("PROFILE", "true");
|
||||
|
||||
import { report, section, startup, tip, top } from "../mod.ts";
|
||||
import { range } from "../src/lib/utils.ts";
|
||||
|
||||
async function main() {
|
||||
await startup();
|
||||
console.log("Starting ...");
|
||||
|
||||
const data = Array.from(range(0, 100));
|
||||
const results = new Map<string, number>();
|
||||
|
||||
for (const a of data) {
|
||||
// with tip/top
|
||||
tip("table_of_it");
|
||||
for (const b of data) {
|
||||
tip("iteration");
|
||||
const result = a + b;
|
||||
// with section
|
||||
const key = section("serialize", () => JSON.stringify({ a, b }));
|
||||
section("insertion", () => results.set(key, result));
|
||||
top("iteration");
|
||||
}
|
||||
top("table_of_it");
|
||||
}
|
||||
|
||||
console.log("Done.");
|
||||
report();
|
||||
}
|
||||
|
||||
if (import.meta.main) await main();
|
Loading…
Add table
Add a link
Reference in a new issue