rename demo example into benchmarks

This commit is contained in:
Géry Debongnie
2019-03-19 13:55:27 +01:00
parent 91e7e00f97
commit 6a2e4dbf2f
8 changed files with 6 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
export const messages = [];
const authors = ["Aaron", "David", "Vincent"];
const content = [
"Lorem ipsum dolor sit amet",
"Sed ut perspiciatis unde omnis iste natus error sit voluptatem",
"Excepteur sint occaecat cupidatat non proident"
];
function chooseRandomly(array) {
const index = Math.floor(Math.random() * array.length);
return array[index];
}
for (let i = 1; i < 16000; i++) {
messages.push({
id: i,
author: chooseRandomly(authors),
msg: `${i}: ${chooseRandomly(content)}`,
likes: 0
});
}