yangl1996/blocktime-sim
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
This is a simulation that demos the effect of block time in interactive
applications. To run the simulation locally, download this directory and run
the following command. You will need to have go (Golang) installed.
go build && ./blocktime-sim
You may change the parameters that the simulation uses. For example, you may
start the simulation with the following command.
./blocktime-sim -n 50ms -b 1s
It is also possible to host the simulation in a web page by compiling it to
Webassembly. Use the following command.
GOOS=js GOARCH=wasm go build -o sim.wasm
To host the web page, serve sim.wasm along with main.html, index.html, and
wasm_exec.js with an HTTP server. Notice that the server must recognize .wasm
file extension and serve it with MIME type application/wasm.