samples/counters.js

changeset 851
41be00d23622
parent 7
5a1b0714df0e
child 952
6d5471a497fb
child 962
ac62e33a99b0
     1.1 --- a/samples/counters.js	Wed May 07 21:33:30 2014 -0700
     1.2 +++ b/samples/counters.js	Wed May 07 20:20:58 2014 +0530
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     1.7   * 
     1.8   * Redistribution and use in source and binary forms, with or without
     1.9   * modification, are permitted provided that the following conditions
    1.10 @@ -33,7 +33,11 @@
    1.11   * This file can be run along with any script you want to run
    1.12   * to print aggregate stat counters from nashorn.
    1.13   *
    1.14 - * Usage:  jjs <your-file.js> counters.js
    1.15 + * Usage:  jjs -J-Dnashorn.debug <your-file.js> counters.js
    1.16   */
    1.17  
    1.18 -Debug.dumpCounters();
    1.19 +if (java.lang.System.getProperty("nashorn.debug") == null) {
    1.20 +    print("Usage: jjs -J-Dnashorn.debug <your-file.js> counters.js");
    1.21 +} else {
    1.22 +    Debug.dumpCounters();
    1.23 +}

mercurial