我安装了Nodejs和SQLITE + sqlite事务,因为我想用sqlite做一些ACID事务
https://github.com/Strix-CZ/sqlite3-transactions
现在我想编写一个nodejs程序来测试我在1秒钟内可以完成的事务数量。或者,反过来说,例如,提交1000个事务需要多长时间。
The tests should work like this:
first we add database and table and insert into table
User: Harry Balance 10
and then iterate the following:
begin transaction
load balance from user Harry
increase his balance by 1
update his balance
if possible commit transaction
do this 1000 times. And then AFTER the last callback finnished tell me how long it took.
但是如果有可能启动事务,等待回调也会很有趣。当回调完成后再次开始交易。这样做100次。然后说它花了多长时间。