예제 #1
0
        /// <summary>
        /// Use to time the time it takes to execute function <c>f</c>.
        /// Logging is a Gauge in the unit seconds
        /// </summary>
        public static T Time <T>(this Logger logger, Func <T> f)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (f == null)
            {
                throw new ArgumentNullException("f");
            }

            return(LoggerModule.Time(logger, null, CSharpFacade.ToFSharpFunc(f)));
        }
예제 #2
0
 /// <summary>
 /// Use to time the time it takes to execute function <c>f</c>. The subPath can be your function name, for
 /// example.
 /// </summary>
 public static T TimePath <T>(this Logger logger, string subPath, Func <T> f, LogLevel level = null)
 {
     if (logger == null)
     {
         throw new ArgumentNullException("logger");
     }
     if (subPath == null)
     {
         throw new ArgumentNullException("subPath");
     }
     if (f == null)
     {
         throw new ArgumentNullException("f");
     }
     return(LoggerModule.Time <T>(logger, subPath, CSharpFacade.ToFSharpFunc(f)));
 }