<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace DbLinq.Util
{
#if !MONO_STRICT
    public
#endif
    static class Profiler
    {
        private static Stopwatch timer = new Stopwatch();
        private static long prevTicks;

        [Conditional("DEBUG")]
        public static void Start()
        {
            timer.Reset();
            timer.Start();
            prevTicks = 0;
        }

        [Conditional("DEBUG")]
        public static void At(string format, params object[] args)
        {
            timer.Stop();
            Console.Write("#AT(time={0:D10}, elapsed={1:D10}) ", timer.ElapsedTicks, timer.ElapsedTicks - prevTicks);
            prevTicks = timer.ElapsedTicks;
            Console.WriteLine(format, args);
            timer.Start();
        }

        [Conditional("DEBUG")]
        public static void Stop()
        {
            timer.Stop();
        }
    }
}<commit_msg>[ThreadStatic] on provider fields.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace DbLinq.Util
{
#if !MONO_STRICT
    public
#endif
    static class Profiler
    {
        [ThreadStatic]
        private static Stopwatch timer = new Stopwatch();
        [ThreadStatic]
        private static long prevTicks;
        [ThreadStatic]
        private static bool profiling;

        [Conditional("DEBUG")]
        public static void Start()
        {
            profiling = true;
            prevTicks = 0;
            timer.Reset();
            timer.Start();
        }

        [Conditional("DEBUG")]
        public static void At(string format, params object[] args)
        {
            if (profiling)
            {
                timer.Stop();
                Console.Write("#AT(time={0:D10}, elapsed={1:D10}) ", timer.ElapsedTicks, timer.ElapsedTicks - prevTicks);
                prevTicks = timer.ElapsedTicks;
                Console.WriteLine(format, args);
                timer.Start();
            }
        }

        [Conditional("DEBUG")]
        public static void Stop()
        {
            profiling = false;
            timer.Stop();
        }
    }
}
{'fraction_non_alphanumeric': 0.1082039911308204, 'fraction_numerical': 0.006208425720620843, 'mean_word_length': 1.8059701492537314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7362439', 'n_tokens_mistral': 622, 'n_tokens_neox': 604, 'n_words': 144}