我想在我的程序中找到一個性能問題,從而檢測與分析代碼。 gprof的創建一個平的輪廓是這樣的: Flat profile:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
27.97 4.
我給定兩個函數用於查找兩個矩陣的乘積: void MultiplyMatrices_1(int **a, int **b, int **c, int n){
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
for (int k = 0; k < n; k++)
c[i][j]