天软金融分析.NET函数大全 > TSL函数 > 系统相关函数 > 性能优化相关函数

GetProfilerInfo    

简述

获得记录的优化信息。
定义
GetProfilerInfo(Clear:Boolean):Array;
参数
名称类型说明
ClearBooleanBoolean。
如果设置为真,则调用后返回优化信息同时取消profiler模式。
如果不带参数或为假,则保留原来的模式,这样在最后函数执行之后,会出现一个profiler窗口
返回Array
数组,优化信息,具体各字段说明如下:
列名 说明
name 函数名称
times 执行次数
seconds 累计时间,单位:秒
op 运算符信息,运算符使用次数和累计时间 返回结果: name:运算符名称 times:执行次数 seconds:累计时间,单位:秒
type 函数类型: tsl:TSL函数信息,TSL函数被调用的堆栈 bin:二进制函数信息,系统函数
  • 范例


    范例01:不弹出profiler窗口
      setprofiler(7); //记录TSL源代码函数调用+二进制函数的调用+指令调用的优化信息

      a:=99;

      b:=inttostr(a); //inttostr是函数

      a:=rand(1000,1); //rand是指令

      a:=select * from a where [0]>0.5 end; //select是指令

      setsysparam(pn_stock(),"SZ000002");

      b:=nday3(100,close()); //nday3也算是指令,不是函数 ,close是函数

      return getprofilerinfo(1);



    返回结果:

    范例02:弹出profiler窗口


    setprofiler(7); //记录TSL源代码函数调用+二进制函数的调用+指令调用的优化信息

      a:=99;

      b:=inttostr(a); //inttostr是函数

      a:=rand(1000,1); //rand是指令

      a:=select * from a where [0]>0.5 end; //select是指令

      setsysparam(pn_stock(),"SZ000002");

      b:=nday3(100,close()); //nday3也算是指令,不是函数 ,close是函数

      t:= getprofilerinfo();

      return b;


    返回结果:返回程序结果的同时,另外弹出profiler窗口
相关