Skip to content

Commit

Permalink
chore: clear data when benchamrk ended
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Mar 6, 2024
1 parent 955c286 commit 9a2f3e0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions demo/benchmark.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
.tip {
font-style: italic;
}

#status {
color: red;
}
</style>
</head>

Expand Down
9 changes: 9 additions & 0 deletions demo/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,13 @@ function updateCost(id: string) {
getElById(id).textContent = `${~~(performance.now() - startTime)}ms`;
}

// clear
await file(fileName).remove();
tx = db.transaction('data', 'readwrite');
store = tx.objectStore('data');
for (const k of idbKeys) {
await store.delete(k);
}
await tx.done;

export default {};

0 comments on commit 9a2f3e0

Please sign in to comment.