Skip to content

Instantly share code, notes, and snippets.

using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace NETCoreTests
{
[TestClass]
public class TestClass
{
[TestMethod]
public void TestMethodPass()
{
using System;
using Microsoft.Extensions.Logging;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
var logFactory = new LoggerFactory()
foreach (var item in collection)
{
DoSomething(item);
}
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
foreach (var item in collection)
{
DoSomething(item);
}
stopWatch.Stop();
static void Main(string[] args)
{
RunStopwatch(() =>
{
foreach (var item in collection)
{
DoSomething(item);
}
});
}
//-----------------------------------------------------------------------
// <copyright file="Benchmark.cs" company="YuGuan Corporation">
// Copyright (c) YuGuan Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DevLib.Diagnostics
{
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using DevLib.Diagnostics;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
Benchmark.Run(i =>
using System;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
// Want to detect which build is used
Console.WriteLine(BuildConfiguration.IsDebug ? "Debug" : "Release");
/// <summary>
/// Convert Image to Icon.
/// </summary>
/// <param name="image">The source image.</param>
public static Icon ConvertToIcon(Image image, bool nullTonull = false)
{
if (image == null)
{
if (nullTonull)
{
using System;
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
public sealed class ExtensionAttribute : Attribute
{
}
}