New measurement function for C#.