Project
dotTrace
Priority
Major
Type
Bug
Fix versions
No Fix versions
State
Fixed
Assignee
Mikhail Pilin
Subsystem
Core
Affected versions
No Affected versions
Fixed in build
No Fixed in build
Duplicate Reporters
No duplicate reporters
  • Created by   Mikhail Pilin
    4 years ago (27 Mar 2008 16:13)
  • Updated by   Vadim Gurov
    4 years ago (27 Mar 2008 16:34)
 
DTRC-728 Invalid measure time for example
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
using System;
using System.Threading;
using JetBrains.dotTrace.Api;

namespace Test1
{
    internal class Program
    {
        private static void WorkerThread()
        {
            while (true)
            {
                Thread.Sleep(2000);
            }
        }

        private static void Main(string[] args)
        {
            //Create a bunch of workers
            for (int i = 0; i < 10; i++)
                new Thread(WorkerThread) {Name = ("Worker " + i), IsBackground = true}.Start();

            Thread.Sleep(1500);
            CPUProfiler.Start();
            Thread.Sleep(1000);
            for (int i = 0; i < 10000; i++)
            {
                double j = Math.Sqrt(i);
            }
            CPUProfiler.StopAndSaveSnapShot();
        }
    }
}

Issue was closed
Comments (1)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Mikhail Pilin
  Mikhail Pilin
27 Mar 2008 16:16
4 years ago
Special thanks for Bruce Thompson who made this test example.