yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Quintiq file version 2.0
#parent: #root
Method PTF_ProfilerStop (
  String filename
) as Boolean id:Method_LibPTF_pnlTestRunner_PTF_ProfilerStop
{
  #keys: '[105690.0.906478879]'
  Body:
  [*
    // Stop the profiler
    profiler := Domain.ExecuteMonitor();
    
    if( not isnull( profiler ) )
    {
      if( profiler.Active() )
      {
        profiler.Active( false );
    
        // Determine the filename to be used. If no filename is provided "profile.txt" is used.
        filename := vhResultLogPath.Value() + ifexpr( filename <> "", filename, "profile.txt" );
    
        profiler.Export( filename );
    
        debuginfo( "PTF: Profiler stopped, file '" + filename + "' generated" );
      }
    }
    else
    {
      debuginfo( "PTF_ProfilerStop: Profiler not found" );
    }
    
    // Return true in all cases.
    return true;
  *]
}