Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
timeコマンド
Search
Satoru Takeuchi
PRO
June 22, 2022
0
120
timeコマンド
以下動画のテキストです
https://youtu.be/_3ABqhVtV4I
Satoru Takeuchi
PRO
June 22, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
eBPF
sat
PRO
1
97
waruiBPF
sat
PRO
0
94
eBPFとwaruiBPF
sat
PRO
4
3k
Pythonのコードの気になる行でスタックトレースを出す
sat
PRO
0
89
ソースコードを読むときの思考プロセスの例 ~markdownのレンダリング方法を知りたかった2 markdownパッケージ~
sat
PRO
0
180
様々なファイルシステム
sat
PRO
0
330
ソースを読む時の思考プロセスの例-MkDocs
sat
PRO
1
410
ソースを読むプロセスの例
sat
PRO
22
18k
メモリマップトファイル
sat
PRO
1
170
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
73
Bash Introduction
62gerente
615
210k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
230
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
70
The Cult of Friendly URLs
andyhume
79
6.7k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Making Projects Easy
brettharned
120
6.5k
Un-Boring Meetings
codingconduct
0
160
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
200
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
120
How STYLIGHT went responsive
nonsquared
100
6k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
260
Transcript
timeコマンド Jun. 19th, 2022 Satoru Takeuchi twitter: satoru_takeuchi
timeコマンド • 引数に与えたコマンドを実行し、CPU使用時間や終了までの所要時間を出力 • 出力の意味 ◦ real: コマンドの実行開始から終了までの所要時間 ◦ user:
コマンド実行中にプロセスが使用した CPU時間 ◦ sys: コマンド実行中に、そのコマンドのためにカーネルが使用した CPU時間
例: 一定時間CPUを使い続けた後に終了 プロセス CPU上で動 作する処理 時間 real user 開始 終了
例: 一定時間システムコールを呼び続けた後に終了 プロセス CPU上で動 作する処理 時間 real user = (a)+(c)+(e)
開始 終了 カーネル プロセス カーネル プロセス (a) (c) (e) (b) (d) sys = (b)+(d)
例: 一定時間CPUを使い続けた後に終了(別プロセスあり) プロセス CPU上で動 作する処理 時間 real user = (a)+(b)+(c)
開始 終了 別プロセス プロセス 別プロセス プロセス (a) (b) (c)
例: 起動直後に寝て起きたらすぐ終了 CPU上で動 作する処理 時間 real user = (a) +
(b) 開始 終了 アイドル (a) (b)
例: 複数コア上で一定時間CPUを使った後に終了 プロセス CPU0上で動作 する処理 時間 real user = (a)
+ (b) 開始 終了 CPU1上で動作 する処理 プロセス 生成 終了 (a) (b)
まとめ • timeコマンドはプロセスの所要時間と、その間のCPU使用時間がわかる • 横で別プロセスが動いていると結果が変わるので性能測定時は要注意 • 並行プログラミングによって性能向上できるかも