Format:
Recent snippets matching tags of Performance
<ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule>
102 Views
no comments
const string PC_CATEGORY = "_Tmp"; const string PC_NAME = "_Tmp"; if (!PerformanceCounterCategory.Exists(PC_CATEGORY)) { CounterCreationDataCollection data = new CounterCreationDataCollection(); CounterCreationData counter = new CounterCreationData(PC_NAME, "", PerformanceCounterType.NumberOfItems32); var pcCategory = PerformanceCounterCategory.Create(PC_CATEGORY, "", PerformanceCounterCategoryType.MultiInstance, data); data.Add(counter);
148 Views
no comments
public class PerformanceTester { public TimeSpan TotalTime { get; private set; } public TimeSpan AverageTime { get; private set; } public TimeSpan MinTime { get; private set; } public TimeSpan MaxTime { get; private set; } public Action Action { get; set; } public PerformanceTester(Action action) {
219 Views
no comments
declare @x int, @y int, @z int set @x = 1 set @y = 2 set @z = 1 -- returns @x (because not equal) select case when @x = @y then null else @x end -- returns null (because equal) select case when @x = @z then null else @x end
593 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace Nixoncorp.LoopPerformance { class Test {
866 Views
no comments
Data units of msec resolution = 0.000301 usec 10 typeof(string) : count: 10000 0.285 +- 0% msec 10 typeof(string).TypeHandle : count: 10000 0.030 +- 3% msec 10 anObj.GetType() == type : count: 10000 0.444 +- 6% msec 10 Type.GetTypeHandle(obj).Equals(tHnd) : count: 10000 0.589 +- 1% msec 10 anObj.GetType() == typeof(string) : count: 10000 0.057 +- 2% msec 10 (anObj is string) : count: 10000 0.113 +- 10% msec
418 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
