Skip to content

Instantly share code, notes, and snippets.

using System;
namespace Monads
{
/// <summary>
/// <code>
/// var r = getUserInput();
/// if(y.TryGetValue(out int i1))
/// {
/// Console.WriteLine("Successfully parsed: {0}", i1);
using System;
using System.Diagnostics;
namespace Monads
{
/// <summary>
/// Монада для возврата значения или ошибки:
/// <code>
/// var r = getUserInput();
/// switch (r)
@DBalashov
DBalashov / find_element.cs
Created June 14, 2023 14:32
Find element in array
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
#pragma warning disable CS8618
var summary = BenchmarkRunner.Run<MainTest>();
// Validating benchmarks:
// ***** BenchmarkRunner: Start *****
// ***** Found 33 benchmark(s) in total *****
// ***** Building 1 exe(s) in Parallel: Start *****
// start dotnet restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in C:\Projects\Test_Benchmarks\Test_Benchmarks\bin\Release\net7.0\1864e80c-9708-420e-bf08-9157be836835
// command took 1,24s and exited with 0
// start dotnet build -c Release --no-restore /p:UseSharedCompilation=false /p:BuildInParallel=false /m:1 /p:Deterministic=true /p:Optimize=true in C:\Projects\Test_Benchmarks\Test_Benchmarks\bin\Release\net7.0\1864e80c-9708-420e-bf08-9157be836835
// command took 3,52s and exited with 0
// ***** Done, took 00:00:04 (4.96 sec) *****
// Found 33 benchmarks:
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure.Internal;
using Npgsql.EntityFrameworkCore.PostgreSQL.Query.Internal;
namespace PostgresExtensions;
00:00:37.345 [INF] [178.134.217.58] [8/realme RMX3834] [Request] POST /api/v1/device/7572e67a-b59b-4181-82b1-fa877961c338/healthcheck responded 200 in 15.1 ms
00:04:07.909 [INF] [178.134.217.58] [8/realme RMX3834] [Request] POST /api/v1/device/7572e67a-b59b-4181-82b1-fa877961c338/healthcheck responded 200 in 14.7 ms
00:06:54.079 [INF] [178.134.217.58] [8/realme RMX3834] [Request] POST /api/v1/device/7572e67a-b59b-4181-82b1-fa877961c338/healthcheck responded 200 in 15.8 ms
00:11:57.037 [WRN] [] [] [Device/DeviceHeartbeatDetectorJob] 1 devices => OFF state due timeout (300 seconds)
00:12:39.328 [INF] [178.134.217.58] [8/realme RMX3834] [Request] POST /api/v1/device/7572e67a-b59b-4181-82b1-fa877961c338/healthcheck responded 200 in 14.8 ms
00:14:36.507 [INF] [178.134.217.58] [8/realme RMX3834] [Request] POST /api/v1/device/7572e67a-b59b-4181-82b1-fa877961c338/healthcheck responded 200 in 15.8 ms
00:19:37.029 [WRN] [] [] [Device/DeviceHeartbeatDetectorJob] 1 devices => OFF state due timeout (300 seconds)
00:20:40.