Difference between revisions of "Compile time"

From Free Pascal wiki
Jump to navigationJump to search
(distinguish between “compile time” and “compile-time”)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
[[Pascal]] modules can be be compiled in a very short time.
 
[[Pascal]] modules can be be compiled in a very short time.
 
A [[Hello, World]] program can be compiled in less than half a second.
 
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.
  
 
'''Compile-time''' refers to the period when a Pascal module is being compiled.
 
'''Compile-time''' refers to the period when a Pascal module is being compiled.
Line 11: Line 12:
 
Information which is not available until the [[Executable program|program]] is being executed is referred to as being known at [[runtime|run-time]].
 
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.
+
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