mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-25 10:22:19 +00:00
Update a few examples.
This commit is contained in:
parent
bd06aa02ba
commit
3778352d39
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -610,6 +610,10 @@ dependencies = [
|
|||||||
"unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"unicode-segmentation 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hello_world"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex"
|
name = "hex"
|
||||||
version = "0.3.2"
|
version = "0.3.2"
|
||||||
|
@ -58,7 +58,8 @@ members = [
|
|||||||
"lib/wasi-tests",
|
"lib/wasi-tests",
|
||||||
"lib/emscripten-tests",
|
"lib/emscripten-tests",
|
||||||
"lib/middleware-common-tests",
|
"lib/middleware-common-tests",
|
||||||
"examples/plugin-for-example"
|
"examples/plugin-for-example",
|
||||||
|
"examples/hello_world"
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
9
examples/hello_world/Cargo.toml
Normal file
9
examples/hello_world/Cargo.toml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[package]
|
||||||
|
name = "hello_world"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["losfair <zhy20000919@hotmail.com>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
7
examples/hello_world/src/main.rs
Normal file
7
examples/hello_world/src/main.rs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fn main() {
|
||||||
|
for i in 0..8 {
|
||||||
|
let s = format!("Hello, {}", i);
|
||||||
|
println!("{}", s);
|
||||||
|
}
|
||||||
|
panic!("OK");
|
||||||
|
}
|
@ -20,7 +20,7 @@ fn main() {
|
|||||||
let diff = millis - last_millis;
|
let diff = millis - last_millis;
|
||||||
if diff >= 100 {
|
if diff >= 100 {
|
||||||
record_count += 1;
|
record_count += 1;
|
||||||
println!("{}", (i - round_count) as f64 / diff as f64);
|
println!("{}", ((i - round_count) as u128) * 1000000 / diff );
|
||||||
last_millis = millis;
|
last_millis = millis;
|
||||||
round_count = i;
|
round_count = i;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user