Runtime
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, run time, run-time, runtime, or execution time is the time during which a program is running (executing), in contrast to other phases of a program's lifecycle such as compile time
Compile time
In computer science, compile time refers to either the operations performed by a compiler , programming language requirements that must be met by source code for it to be successfully compiled , or properties of the program that can be reasoned about at compile time.The operations performed at...

, link time
Link time
In computer science, link time refers to either the operations performed by a linker or programming language requirements that must be met by compiled source code for it to be successfully linked ....

, load time, etc.

A run-time error is detected after or during the execution of a program, whereas a compile-time error is detected by the compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

 before the program is ever executed. Type checking, storage allocation, code generation, and code optimization are typically done at compile time, but may be done at run time depending on the particular language and compiler.

Implementation details

In most cases, the execution of a program begins after a loader
Loader (computing)
In computing, a loader is the part of an operating system that is responsible for loading programs. It is one of the essential stages in the process of starting a program, as it places programs into memory and prepares them for execution...

 performed the necessary memory setup and linked the program with any dynamically linked libraries it needs. In some cases a language or implementation will have these tasks done by the language runtime instead, though this is unusual in mainstream languages on common consumer operating systems.

Some program debugging can only be performed (or are more efficient or accurate) when performed at runtime. Logical errors
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

 and array bounds checking are examples. For this reason, some programming bugs
Software bug
A software bug is the common term used to describe an error, flaw, mistake, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways. Most bugs arise from mistakes and errors made by people in either a program's...

 are not discovered until the program is tested in a "live" environment with real data, despite sophisticated compile-time checking and pre-release testing. In this case, the end user may encounter a runtime error message.

Application errors — exceptions

Exception handling
Exception handling
Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of exceptions, special conditions that change the normal flow of program execution....

 is one language feature designed to handle runtime errors, providing a structured way to catch completely unexpected situations as well as predictable errors or unusual results without the amount of inline error checking required of languages without it. More recent advancements in runtime engines enable automated exception handling
Automated Exception Handling
Automated exception handling is a computing term referring to the computerized handling of errors. Runtime engines such as those for the Java language or Microsoft .Net lend themselves to an automated mode of exception or error handling. In these environments software errors do not 'crash' the...

 which provides 'root-cause' debug information for every exception of interest and is implemented independent of the source code, by attaching a special software product to the runtime engine.

Orthographic styling

Some users prefer an orthographic styling in which "run-time" as an adjective is hyphen
Hyphen
The hyphen is a punctuation mark used to join words and to separate syllables of a single word. The use of hyphens is called hyphenation. The hyphen should not be confused with dashes , which are longer and have different uses, or with the minus sign which is also longer...

ated, whereas "runtime" as a noun is styled solid (closed up). Examples:
  • "Polymorphism requires run-time binding rather than compile-time binding."
  • "The runtime of the algorithm is order n2."

As elsewhere with linguistic prescription
Linguistic prescription
In linguistics, prescription denotes normative practices on such aspects of language use as spelling, grammar, pronunciation, and syntax. It includes judgments on what usages are socially proper and politically correct...

 for the styling of compounds
Compound (linguistics)
In linguistics, a compound is a lexeme that consists of more than one stem. Compounding or composition is the word formation that creates compound lexemes...

 (open, hyphenated, or solid), natural language
Natural language
In the philosophy of language, a natural language is any language which arises in an unpremeditated fashion as the result of the innate facility for language possessed by the human intellect. A natural language is typically used for communication, and may be spoken, signed, or written...

 often pays no heed.

See also

  • Name binding
    Name binding
    In programming languages, name binding is the association of objects with identifiers. An identifier bound to an object is said to reference that object. Machine languages have no built-in notion of identifiers, but name-object bindings as a service and notation for the programmer is implemented...

  • Compile time
    Compile time
    In computer science, compile time refers to either the operations performed by a compiler , programming language requirements that must be met by source code for it to be successfully compiled , or properties of the program that can be reasoned about at compile time.The operations performed at...

     and compiling
  • Interpreter (computing)
    Interpreter (computing)
    In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...

  • Runtime Type Information
  • Run-time system
    Run-time system
    A run-time system is a software component designed to support the execution of computer programs written in some computer language...

  • Runtime library
    Runtime library
    In computer programming, a runtime library is a special program library used by a compiler, to implement functions built into a programming language, during the execution of a computer program...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK