A method for accurately measuring feature sizes and quantifying the beam spot size in a CDSEM at real time is provided. The inventive method is based on a scanning microscope and it works on both conductive and non-conductive features. The measurement of conductive feature includes first providing a conductive feature on a surface of a substrate (the substrate maybe an insulator, a semiconductor or a material stack thereof). The conductive feature is then connected to ground and thereafter an electron beam probe raster scans the sample. When the electron beam probe hits the conductive feature the spot will have a negative potential. The potential difference between the spot and the ground will induce an electrical current flow. When the electrical beam is off the conductive feature, there will be no current flow. Therefore, by measuring the current response to the location of the beam spot, the dimension of the conductive feature can be derived.