add main function and calc time,by the way I modify the compare.to.example function