Questions tagged [measurement]
499 questions
398
votes
26 answers
Easily measure elapsed time
I am trying to use time() to measure various points of my program.
What I don't understand is why the values in the before and after are the same? I understand this is not the best way to profile my program, I just want to see how long something…

hap497
- 154,439
- 43
- 83
- 99
144
votes
8 answers
How do I measure separate CPU core usage for a process?
Is there any way to measure a specific process CPU usage by cores?
I know top is good for measuring the whole system's CPU usage by cores and taskset can provide information about which CPU core is allowed for the process to run on.
But how do I…

elang
- 1,541
- 2
- 10
- 4
127
votes
10 answers
How can I measure the speed of code written in PHP?
How can I say which class of many (which all do the same job) execute faster? is there a software to measure that?

M. A. Kishawy
- 5,001
- 11
- 47
- 72
121
votes
11 answers
Font size relative to the user's screen resolution?
I have a fluid website and the menu is 20% of its width. I want the font size of the menu to be measured properly so it always fits the width of the box and never wrap to the next line.
I was thinking of using "em" as a unit but it is relative to…

barakuda28
- 2,762
- 6
- 23
- 32
76
votes
4 answers
simplest tool to measure C program cache hit/miss and cpu time in linux?
I'm writing a small program in C, and I want to measure it's performance.
I want to see how much time do it run in the processor and how many cache hit+misses has it made. Information about context switches and memory usage would be nice to have…

jperelli
- 6,988
- 5
- 50
- 85
72
votes
5 answers
Units of a Fourier Transform (FFT) when doing Spectral Analysis of a Signal
My question has to do with the physical meaning of the results of doing a spectral analysis of a signal, or of throwing the signal into an FFT and interpreting what comes out using a suitable numerical package,
Specifically:
take a signal, say a…

Assad Ebrahim
- 6,234
- 8
- 42
- 68
62
votes
10 answers
Stopwatch class for Java
Which Java class should you use for time performance measurements?
(One could use any date/time class, but the reason I'm asking is in .Net there's a designated Stopwatch class for this purpose)

ripper234
- 222,824
- 274
- 634
- 905
61
votes
4 answers
Memory usage of Docker containers
I am using Docker to run some containerized apps. I am interested in measuring how much resources they consume (as far as regarding CPU and Memory usage).
Is there any way to measure the resources consumed by Docker containers like RAM & CPU…

Paris
- 6,323
- 7
- 31
- 49
55
votes
6 answers
Difference between android dimension: pt and dp
The documentation says that 160 dp (density-independent) equals 1 inch. And 72 pt is also 1 inch. So I don't see why android define a dp measurement while it seems to work the same as points. Can anybody explain that? Why should I use dp if I can…

Herbert
- 559
- 1
- 5
- 3
55
votes
2 answers
rem px in Javascript
I use this code in JS:
bigPhoto.setAttribute("width", "200rem");
The result is in pixel in html source,
But:
When I change it to 20rem the photo become really small.
I couldn't solve the problem which is mentioned in the photos.

Malus Jan
- 1,860
- 2
- 22
- 26
50
votes
2 answers
Why is Graphics.MeasureString() returning a higher than expected number?
I'm generating a receipt and am using the Graphics object to call the DrawString method to print out the required text.
graphics.DrawString(string, font, brush, widthOfPage / 2F, yPoint, stringformat);
This works fine for what I needed it to do. I…

Brandon
- 68,708
- 30
- 194
- 223
41
votes
7 answers
If I call getMeasuredWidth() or getWidth() for layout in onResume they return 0
If I call getMeasuredWidth() or getWidth() for layout in onResume they returns 0.
I think that view it's not drawn yet in this moment.
Also I think that I need to put getMeasuredWidth() or getWidth() in callback method called after layout is drawn…

mobiledev Alex
- 2,228
- 2
- 28
- 30
38
votes
2 answers
What is a bad, decent, good, and excellent F1-measure range?
I understand F1-measure is a harmonic mean of precision and recall. But what values define how good/bad a F1-measure is? I can't seem to find any references (google or academic) answering my question.

KubiK888
- 4,377
- 14
- 61
- 115
35
votes
4 answers
How can I measure pixels in Chrome without an extension?
Due to security limitations at work, I am not allowed to install Chrome extensions. Chrome has a ruler built in to the developer tools, but I can't figure out how to define start and end points like a ruler would permit.
Are there any tools or…

adamdport
- 11,687
- 14
- 69
- 91
35
votes
14 answers
How do you measure page load speed?
I am trying to quantify "site slowness". In the olden days you just made sure that your HTML was lightweight, images optimized and servers not overloaded. In high end sites built on top of modern content management systems there are a lot more…

deadprogrammer
- 11,253
- 24
- 74
- 85