/// <summary> /// 获取NTMiner所支持的所有内核的近处名 /// </summary> /// <param name="kernelSet"></param> /// <returns></returns> public static HashSet <string> GetAllKernelProcessNames(this IKernelSet kernelSet) { HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase); foreach (var kernel in kernelSet.AsEnumerable().ToArray()) { hashSet.Add(kernel.GetProcessName()); } return(hashSet); }
/// <summary> /// 获取NTMiner所支持的所有内核的近处名 /// </summary> /// <param name="kernelSet"></param> /// <returns></returns> public static HashSet <string> GetAllKernelProcessNames(this IKernelSet kernelSet) { #if DEBUG VirtualRoot.Stopwatch.Restart(); #endif HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase); foreach (var kernel in kernelSet) { hashSet.Add(kernel.GetProcessName()); } #if DEBUG Write.DevWarn($"耗时{VirtualRoot.Stopwatch.ElapsedMilliseconds}毫秒 {nameof(KernelSetExtension)}.{nameof(GetAllKernelProcessNames)}()"); #endif return(hashSet); }
/// <summary> /// 获取NTMiner所支持的所有内核的近处名 /// </summary> /// <param name="kernelSet"></param> /// <returns></returns> public static HashSet <string> GetAllKernelProcessNames(this IKernelSet kernelSet) { #if DEBUG Write.Stopwatch.Start(); #endif HashSet <string> hashSet = new HashSet <string>(StringComparer.OrdinalIgnoreCase); foreach (var kernel in kernelSet.AsEnumerable()) { hashSet.Add(kernel.GetProcessName()); } #if DEBUG var elapsedMilliseconds = Write.Stopwatch.Stop(); if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) { Write.DevTimeSpan($"耗时{elapsedMilliseconds} {nameof(KernelSetExtension)}.{nameof(GetAllKernelProcessNames)}()"); } #endif return(hashSet); }