Added schedule.

This commit is contained in:
retoor 2025-01-28 17:11:30 +01:00
parent 99d335ac24
commit 4f1a48c197

View File

@ -333,16 +333,18 @@ class App extends EventHandler {
me.emit(data.channel_uid,data) me.emit(data.channel_uid,data)
}) })
} }
async benchMark(times) { async benchMark(times,message) {
if(!times) if(!times)
times = 100 times = 100
if(!message)
message = "Benchmark Message"
let promises = [] let promises = []
const me = this const me = this
for(let i = 0; i < times; i++){ for(let i = 0; i < times; i++){
promises.push(this.rpc.getChannels().then(channels=>{ promises.push(this.rpc.getChannels().then(channels=>{
channels.forEach(channel=>{ channels.forEach(channel=>{
me.rpc.sendMessage(channel.uid,`Haha ${i}`).then(data=>{ me.rpc.sendMessage(channel.uid,`${message} ${i}`).then(data=>{
console.info(data)
}) })
}) })
})) }))