Based on time when determining the efficiency of algorithm is measured by
-
Counting microseconds
-
Counting the number of key operations
-
Counting the number of statements
-
Counting the kilobytes of algorithm
Algorithm efficiency is measured by counting the number of key operations (like comparisons, assignments, etc.). Counting microseconds is machine-dependent, making it unreliable for comparing algorithms across different platforms.
Algorithmic time efficiency is measured in an abstract, machine-independent way by counting the number of key/basic operations (comparisons, assignments, arithmetic steps) an algorithm performs as a function of input size — this is the basis of Big-O time complexity analysis. Counting actual microseconds is unreliable because it varies with hardware, compiler, and system load. Counting statements is imprecise since a single statement (e.g., inside a loop) can execute a variable number of times, and what matters is operation count, not source-line count. Kilobytes measures space/memory usage, not time — that's a description of space complexity, not time complexity.