CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

1.3 Do you have the time?

Clock objects can be used to:

  • keep track of elapsed time;
  • wait a specified amount of time.

Message

Meaning

Arguments

wait

wait

number of seconds

time

elapsed time (sec)

none

reset

reset elapsed time

none

Note:

  • time is reset at object declaration
  • number of seconds may have a fractional part.

Examples: c1clock.cpp c1clock2.cpp