Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1988480
  • 博文数量: 27
  • 博客积分: 10027
  • 博客等级: 上将
  • 技术积分: 1865
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-19 09:10
文章分类

全部博文(27)

文章存档

2010年(2)

2009年(3)

2008年(22)

分类:

2008-05-09 09:18:14

方法1: cputime
 

>> help cputime
 CPUTIME CPU time in seconds.
    CPUTIME returns the CPU time in seconds that has been used
    by the MATLAB process since MATLAB started.
 
    For example:
 
        t=cputime; your_operation; cputime-t
 
    returns the cpu time used to run your_operation.
  
    The return value may overflow the internal representation
    and wrap around.

 
方法2: tic and toc
 

>> help tic
 TIC Start a stopwatch timer.
    TIC and TOC functions work together to measure elapsed time.
    TIC saves the current time that TOC uses later to measure
    the elapsed time. The sequence of commands:
    
              TIC
              operations
              TOC
 
    measures the amount of time MATLAB takes to complete the one
    or more operations specifed here by "operations" and displays
    the time in seconds.

 
    两种方法各有适用范围,应根据需求而定。
阅读(3847) | 评论(0) | 转发(0) |
0

上一篇:写论文·开题

下一篇:Just Play It Cool

给主人留下些什么吧!~~