mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
test
This commit is contained in:
parent
5dc1a4ae4e
commit
b0dc2fab13
28
main.js
28
main.js
@ -2,13 +2,23 @@
|
||||
// /**@type {string}*/
|
||||
// const COOKIE = (process.argv.slice(2))[0].substr(7);
|
||||
// main(COOKIE);
|
||||
import fs from 'fs';
|
||||
fs.writeFile('test.txt', 'test',()=>{
|
||||
fs.readFile('test.txt',(err,data)=>{
|
||||
if (err) {
|
||||
console.error(err);
|
||||
} else {
|
||||
console.log(data.toString());
|
||||
}
|
||||
// import fs from 'fs';
|
||||
const delay = time => {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, time)
|
||||
})
|
||||
});
|
||||
};
|
||||
const P = new Promise((resolve) => {
|
||||
(async ()=>{
|
||||
for (let index = 0; index < 100; index++) {
|
||||
console.log(new Date(Date.now()).toLocaleString());
|
||||
await delay(1000)
|
||||
}
|
||||
resolve()
|
||||
})()
|
||||
});
|
||||
P.then(()=>{
|
||||
console.log('运行结束');
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user