Files
sdk/runtime/lib/stopwatch.cc
T
turnidge@google.com 14f614da12 Use the return value of vm native methods to set the return value,
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).

Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00

24 lines
666 B
C++

// Copyright (c) 2012, 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.
#include "vm/bootstrap_natives.h"
#include "vm/object.h"
#include "vm/os.h"
namespace dart {
DEFINE_NATIVE_ENTRY(Stopwatch_now, 0) {
// TODO(iposva): investigate other hi-res time sources such as cycle count.
return Integer::New(OS::GetCurrentTimeMicros());
}
DEFINE_NATIVE_ENTRY(Stopwatch_frequency, 0) {
// TODO(iposva): investigate other hi-res time sources such as cycle count.
return Integer::New(1000000);
}
} // namespace dart