Fast electrical and optical measurements