Difference between revisions of "Compile time"

From Free Pascal wiki
Jump to navigationJump to search
m
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Compile_time}}
+
{{Compile time}}
  
'''Compile time''' refers to the period when a [[Pascal]] program is being compiled, and is usually used to refer to information known by the [[Compiler|compiler]] which it can use in compiling the program. Examples of such information available at compile time include [[compiler switch]]es, values of [[Identifier|identifiers]] defined as [[Const|const]], quoted [[String|strings]], and the actual text of the program.
+
'''Compile time''' is the duration it takes to compile a module.
 +
[[Pascal]] modules can be be compiled in a very short time.
 +
A [[Hello, World]] program can be compiled in less than half a second.
 +
The [[FPC]] reports the time it took if the command line option <syntaxhighlight lang="bash" inline>-vi</syntaxhighlight> (show general information) is set.
  
Information which is not available until the [[Program|program]] is being executed is referred to as being known at [[run time]].
+
'''Compile-time''' refers to the period when a Pascal module is being compiled.
 +
Thus “Compile-time information” refers to information known by the [[Compiler|compiler]] during compilation.
 +
Examples of such information available at compile-time include [[compiler switch]]es, values of [[Identifier|identifiers]] defined as [[Const|const]], quoted [[String|strings]], and the actual text of the program.
  
Information available at compile time is usually more efficient for the program as [[Initialization|initialization]] of constants and value-defined [[Var|variables]] can be done once, when the program is compiled, as opposed to doing so at run time each time the program is started.
+
Information which is not available until the [[Executable program|program]] is being executed is referred to as being known at [[runtime|run-time]].
 +
 
 +
Information available at compile-time is usually more efficient for the program as [[Initialization|initialization]] of [[Constant|constants]] and value-defined [[Var|variables]] can be done once, when the program is compiled, as opposed to doing so at runtime each time the program is started.
 +
 
 +
== see also ==
 +
* [[compile-time error]]
 +
* [[compile time expressions|compile-time expressions]]
 +
* [[compile time variables|compile-time variables]]

Latest revision as of 01:28, 24 June 2020

English (en) suomi (fi) français (fr)

Compile time is the duration it takes to compile a module. Pascal modules can be be compiled in a very short time. A Hello, World program can be compiled in less than half a second. The FPC reports the time it took if the command line option -vi (show general information) is set.

Compile-time refers to the period when a Pascal module is being compiled. Thus “Compile-time information” refers to information known by the compiler during compilation. Examples of such information available at compile-time include compiler switches, values of identifiers defined as const, quoted strings, and the actual text of the program.

Information which is not available until the program is being executed is referred to as being known at run-time.

Information available at compile-time is usually more efficient for the program as initialization of constants and value-defined variables can be done once, when the program is compiled, as opposed to doing so at runtime each time the program is started.

see also