Electron-beam lithography is used extensively in nanoscience and technology for making masks for the semiconductor industry and, on a limited scale, for maskless lithography: that is, writing the patterns directly on the chip. We expect the latter application to extend in the years to come. Control of the dimensions of the written structures is essential in the semiconductor industry. For 45 nm generation, which is presently under development and should reach production at the end of the decade, the required control over the line width is between 1.5 and 5 nm, depending on the application. One of the factors of influence on the line-width control is the statistics in the number of electrons illuminating the resist. This effect gives line edge roughness, or in other words a lack of control over the local position of a resist edge. This has long been recognized and often discussed. Recently, we developed an analytic model for the line edge position variation, which we shall illustrate and expand in this paper. The model, supported by Monte Carlo simulations, demonstrates that the line-width variation is inversely proportional to the dose used for the illumination of the resist. This makes it impossible to increase the lithography throughput by developing ultrasensitive resists. For 45 nm features written with a typical resolution of 30 nm, a 30 microC/cm2 resist gives 3 nm line-width variation over line segments of 45 nm long. The line width is usually measured in an adapted critical dimension scanning electron microscope (CD-SEM). This measurement needs to be more precise than the result of the lithography step, so the requirements are typically sub-nm. Apart from all the problems to avoid systematic errors, this measurement also suffers from statistical variations, resulting from the finite number of electrons used for the measurement. In this paper we shall derive an estimate for that variation with a similar model as used for the shot noise effect in the lithography step. One of the conclusions is that for the most precise measurements of the line width it is not advisable to tune the CD-SEM for the best resolution. It is better to allow a larger probe size of the electron beam because that can be accompanied by a much larger current and thus a decrease in the noise level.