How does Timer work?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How does Timer work?

Sanjiv Gupta
I slightly modified the Kaleidoscope example to print the timing data using the NamedRegionTimer as below:

  // Run the main "interpreter loop" now.
  {
  const char *GroupName = "MainLoop";
  NamedRegionTimer T("Kaleidoscope", GroupName, true);
  MainLoop();
  }

My assumption was that when T goes out of scope, it will emit the data on the command line. But I see nothing.
How does NamedRegionTimer work ?

- sanjiv

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How does Timer work?

Sanjiv Gupta
ping.

On Mon, May 9, 2011 at 10:20 PM, Sanjiv <[hidden email]> wrote:
I slightly modified the Kaleidoscope example to print the timing data using the NamedRegionTimer as below:

  // Run the main "interpreter loop" now.
  {
  const char *GroupName = "MainLoop";
  NamedRegionTimer T("Kaleidoscope", GroupName, true);
  MainLoop();
  }

My assumption was that when T goes out of scope, it will emit the data on the command line. But I see nothing.
How does NamedRegionTimer work ?

- sanjiv


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How does Timer work?

Duncan Sands
Hi Sanjiv,

> On Mon, May 9, 2011 at 10:20 PM, Sanjiv <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     I slightly modified the Kaleidoscope example to print the timing data using
>     the NamedRegionTimer as below:
>
>        // Run the main "interpreter loop" now.
>        {
>        const char *GroupName = "MainLoop";
>        NamedRegionTimer T("Kaleidoscope", GroupName, true);
>        MainLoop();
>        }
>
>     My assumption was that when T goes out of scope, it will emit the data on
>     the command line. But I see nothing.
>     How does NamedRegionTimer work ?

I think you only get output if you run with the -time-passes option.  Also, I
think info is only output when the program exits, not immediately.

Ciao, Duncan.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev