The classic definition is the ratio of shear stress to shear rate. Imagine two plates separated by a distance x, of area A, with the space between filled with a liquid. Since viscosity is the measure of a fluid's resistance to flow, it corresponds to the internal friction of a liquid and is impacted by the level of solids and the temperature of the coating, as well as other operating conditions. In general, the higher the viscosity, the slower the flow of the liquid. The measurement involved determining the time it took for the liquid to run out the hole.
Modern devices work on any one of several principals.
Cambridge imparts a magnetic force on a piston and measures the speed. Another device uses a heavy piston and measures the speed, anothers rotates a cylinder inside a coaxial sleeve and measures the drag force on the sleeve. Some devices vibrate and measure the attenuation which depends on viscosity and density. Some devices force the liquid through a small hole at a controlled flow rate then measure the pressure across the hole to infer viscosity . If you are working with hydrocarbons like fuel or lubricating oil the conversion is simple.