Consumed memory per process
Date : March 29 2020, 07:55 AM
|
cpu time consumed by a process and its threads
Tag : .net , By : Valentine
Date : March 29 2020, 07:55 AM
like below fixes the issue Process Uptime is the amount of wall clock (I think) time that passed between the first thread starting and the last thread ending. You need to look at User time: 0 days 0:26:24.000, that is what all those lines should add up to. To get the total CPU time used you need to do User Time + Kernel Time
|
`clock()` gives usual clocks instead of CPU clocks
Date : March 29 2020, 07:55 AM
seems to work fine I used to take clock() to get CPU time of my algorithms. However, it does not seem to work anymore. I have a Windows 10 VM with 8 CPUs as also seen in the resource monitor. , Yeah, it's broken on Windows.
|
What do matrix clocks solve but vector clocks can't?
Date : March 29 2020, 07:55 AM
|
Number of clocks consumed by same functions changes drastically depending on its order of execution
Date : March 29 2020, 07:55 AM
To fix this issue I was able to reproduce your original result (with a minor tweak to print the time correctly): https://ideone.com/ilQcmU. Then I made a version that didn't time the call to printf, since that's slow and unrelated to the thing you're timing: https://ideone.com/gVC01c. ...
int result;
start = clock();
result = seqsearch(arr,20000,search);
end = clock();
printf("\nSearch for %d :%d\n",search, result);
consumed = end - start;
printf("No. of clocks consumed = %ld\n",consumed);
time = (double)consumed/CLOCKS_PER_SEC;
printf("Runtime = %lf\n",time);
...
Search for 17777 :17777
No. of clocks consumed = 10
Runtime = 0.000010
Search for 17777 :17777
No.of clocks consumed:9
Runtime:0.000009
...
int result, i;
for(i = 0; i < 10; i++) {
start = clock();
result = seqsearch(arr,20000,search);
end = clock();
printf("\nSearch for %d :%d\n",search, result);
consumed = end - start;
printf("No. of clocks consumed = %ld\n",consumed);
time = (double)consumed/CLOCKS_PER_SEC;
printf("Runtime = %lf\n",time);
}
...
...
int i;
for(i = 0; i < 10; i++) {
start = clock();
printf("\nSearch for %d :%d\n",search, seqsearch(arr,20000,search));
end = clock();
...
|