What is the best way to measure how long code takes to execute?

后端 未结 10 1246
梦谈多话
梦谈多话 2020-12-08 04:04

I\'m trying to determine which approach to removing a string is the fastest.

I simply get the start and end time a

10条回答
  •  天命终不由人
    2020-12-08 04:30

    You can also use log4net, simply add log.Info("Test") where you wanna track stuff and you will find all your info and the time that line was executed in a txt file, for example: 2018-12-13 10:02:16,704 [9] INFO Hms.Domain.Concrete.RoomsRepository [(null)] - Test Read more about it here: https://www.infoworld.com/article/3120909/application-development/how-to-work-with-log4net-in-c.html

提交回复
热议问题