1
0
mirror of synced 2026-03-01 00:07:56 +08:00
Files
SnowFlake-IdGenerator/Node.js/test/test2.js
bonn 2308932d25 增加TypeScript版本及其他优化 (#11)
* 基本可运行,待优化

* 增加注释

* 增加注释说明,更容易理解

* 提交package-lock.json文件,保证依赖版本一致
2021-08-31 11:42:13 +08:00

20 lines
394 B
JavaScript

const GenId = require('..')
function test1() {
const genid = new GenId({ WorkerId: 1 })
for (let index = 0; index < 5000; index++) {
console.log(genid.NextId());
}
}
function test2() {
const genid = new GenId({ WorkerId: 1 })
const id = genid.NextId()
console.log(typeof (id))
console.log(id, id.toString().length)
}
function main() {
test2()
}
main()