Files
sdk/runtime/bin/timer.dart
T
ager@google.com b2b123d24b Update Timer API to take the callback as the last parameter.
This makes the code easier to read when the callback actually does
work:

  new Timer(1000, (t) {
    // do
    // lots
    // of
    // stuff
  });

Also, it is more consistent with the rest of the APIs.

R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9597015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4945 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-05 12:43:41 +00:00

24 lines
669 B
Dart

// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
interface Timer default _Timer{
/**
* Creates a new timer. The [callback] callback is invoked after
* [milliSeconds] milliseconds.
*/
Timer(int milliSeconds, void callback(Timer timer));
/**
* Creates a new repeating timer. The [callback] is invoked every
* [milliSeconds] millisecond until cancelled.
*/
Timer.repeating(int milliSeconds, void callback(Timer timer));
/**
* Cancels the timer.
*/
void cancel();
}