Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
CodeTools[Usage]
使い方
CodeTools[Usage](expression, options)
CodeTools[CPUTime](expression)
CodeTools[RealTime](expression)
モデルの説明
コマンド Usage は、expression の評価用の時間およびメモリ使用統計を記録します。
デフォルトでは、使用統計が印刷され、expression の評価結果が返されます。
オプション output=value を与えることで、value が realtime、cputime、bytesused、bytesalloc または output のいずれかである統計のひとつを返すか、または、複数の出力や出力のリストを指定することができます。複数の出力は指定された順番で返されます。expression の評価からの出力が式列の場合、出力の途中で表示される場合は、リストとして返されます。
メモリはバイト単位で、時間は秒単位で返されます。
output は、すべての統計を含む記録を返す all になることもあります。その場合、デフォルトでは統計は印刷されません。
オプション quiet=truefalse を与えることで、統計を印刷しないようにする(または、output=all のとき強制的に印刷するようにする)ことができます。
CPUTime(expression) は Usage(expression, output=[cputime,output], quiet)を呼び出します。
RealTime(expression) は Usage(expression, output=[realtime,output], quiet)を呼び出します。
アプリケーションと例題
with(CodeTools):
Usage(ifactor(32!+1));
memory used=10.11MiB, alloc change=8.12MiB, cpu time=0.17s, real time=0.18s
Usage(ifactor(33!+1),output='bytesused');
memory used=11.56MiB, alloc change=9.50MiB, cpu time=0.19s, real time=0.19s
Usage(ifactor(36!+1),output='all');
data:=Usage(ifactor(39!+1),output='all', quiet=false);
memory used=62.10MiB, alloc change=51.62MiB, cpu time=1.16s, real time=1.20s
data[bytesused];
Usage(ifactor(40!+1),output=['cputime','bytesused']);
memory used=4.68MiB, alloc change=3.37MiB, cpu time=0.11s, real time=0.12s
Usage(ifactor(42!+1),output=['cputime','bytesused'],quiet);
with(LinearAlgebra):
Usage(LUDecomposition(RandomMatrix(25)),output='all');
Usage(LUDecomposition(RandomMatrix(35)),output=['cputime','output']);
memory used=8.46MiB, alloc change=0 bytes, cpu time=0.12s, real time=0.12s
Usage(LUDecomposition(RandomMatrix(45)),output=['cputime','output','bytesused']);
memory used=20.16MiB, alloc change=0 bytes, cpu time=0.28s, real time=0.28s
CPUTime(ifactor(45!+1));
RealTime(ifactor(46!+1));
関連項目
kernelopts, time
Download Help Document