Skip to content

Instantly share code, notes, and snippets.

@shuhei-fujita
Created July 9, 2022 17:33
Show Gist options
  • Save shuhei-fujita/45e7071b77a8a9edae30b675c5053b86 to your computer and use it in GitHub Desktop.
Save shuhei-fujita/45e7071b77a8a9edae30b675c5053b86 to your computer and use it in GitHub Desktop.
rustc main.rs
fn main() {
// 世界よ、こんにちは
println!("Hello, world!");
}
@shuhei-fujita
Copy link
Author

shuhei-fujita commented Jul 9, 2022

実行速度
Linux
time
https://www.server-memo.net/tips/runtime_research.html

~/git/private/playground_rust  $ time ./hello_world 
Hello, world!
./hello_world  0.00s user 0.00s system 60% cpu 0.005 total

https://qiita.com/tossh/items/659e5934e52b38183200

項目 意味
real プログラムの呼び出しから終了までにかかった実時間(秒)
user プログラム自体の処理時間(秒)(ユーザCPU時間)
sys プログラムを処理するために、OSが処理をした時間(秒)(システム時間)

@shuhei-fujita
Copy link
Author

shuhei-fujita commented Jul 9, 2022

コードの画像を生成
vim-siliconもある
https://wonderwall.hatenablog.com/entry/rust-silicon

cargo install silicon  
silicon hello_world.rs -o hello_world.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment