java中stopwatch,Java StopWatch.stop方法代碼示例

本文整理匯總了Java中org.hsqldb.lib.StopWatch.stop方法的典型用法代碼示例。如果您正苦於以下問題:Java StopWatch.stop方法的具體用法?Java StopWatch.stop怎麽用?Java StopWatch.stop使用的例子?那麽恭喜您, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.hsqldb.lib.StopWatch的用法示例。

在下文中一共展示了StopWatch.stop方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於我們的係統推薦出更棒的Java代碼示例。

示例1: openDatabases

​點讚 2

import org.hsqldb.lib.StopWatch; //導入方法依賴的package包/類

/**

* Opens this server's database instances. This method returns true If

* at least one database goes online, otherwise it returns false.

*

* If opening any of the databases is attempted and an exception is

* thrown, the server error is set to this exception.

*/

final boolean openDatabases() {

printWithThread("openDatabases() entered");

boolean success = false;

setDBInfoArrays();

for (int i = 0; i < dbAlias.length; i++) {

if (dbAlias[i] == null) {

continue;

}

printWithThread("Opening database: [" + dbType[i] + dbPath[i]

+ "]");

StopWatch sw = new StopWatch();

int id;

try {

id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,

dbProps[i]);

dbID[i] = id;

success = true;

} catch (HsqlException e) {

printError("Database [index=" + i + ", db=" + dbType[i]

+ dbPath[i] + ", alias=" + dbAlias[i]

+ "] did not open: " + e.toString());

setServerError(e);

dbAlias[i] = null;

dbPath[i] = null;

dbType[i] = null;

dbProps[i] = null;

continue;

}

sw.stop();

String msg = "Database [index=" + i + ", id=" + id + ", db="

+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]

+ "] opened successfully";

print(sw.elapsedTimeToMessage(msg));

}

printWithThread("openDatabases() exiting");

if (isRemoteOpen) {

success = true;

}

if (!success && getServerError() == null) {

// database alias / path list is empty or without full info for any DB

setServerError(Error.error(ErrorCode.SERVER_NO_DATABASE));

}

return success;

}

開發者ID:tiweGH,項目名稱:OpenDiabetes,代碼行數:69,

示例2: openDatabases

​點讚 2

import org.hsqldb.lib.StopWatch; //導入方法依賴的package包/類

/**

* Opens this server's database instances. This method returns true If

* at least one database goes online, otherwise it returns false.

*

* If openning any of the databases is attempted and an exception is

* thrown, the server error is set to this exception.

*/

final boolean openDatabases() {

printWithThread("openDatabases() entered");

boolean success = false;

setDBInfoArrays();

for (int i = 0; i < dbAlias.length; i++) {

if (dbAlias[i] == null) {

continue;

}

printWithThread("Opening database: [" + dbType[i] + dbPath[i]

+ "]");

StopWatch sw = new StopWatch();

int id;

try {

id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,

dbProps[i]);

dbID[i] = id;

success = true;

} catch (HsqlException e) {

printError("Database [index=" + i + ", db=" + dbType[i]

+ dbPath[i] + ", alias=" + dbAlias[i]

+ "] did not open: " + e.toString());

setServerError(e);

dbAlias[i] = null;

dbPath[i] = null;

dbType[i] = null;

dbProps[i] = null;

continue;

}

sw.stop();

String msg = "Database [index=" + i + ", id=" + id + ", db="

+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]

+ "] opened sucessfully";

print(sw.elapsedTimeToMessage(msg));

}

printWithThread("openDatabases() exiting");

if (isRemoteOpen) {

success = true;

}

if (!success && getServerError() == null) {

// database alias / path list is empty or without full info for any DB

setServerError(Error.error(ErrorCode.SERVER_NO_DATABASE));

}

return success;

}

開發者ID:Julien35,項目名稱:dev-courses,代碼行數:69,

示例3: openDatabases

​點讚 2

import org.hsqldb.lib.StopWatch; //導入方法依賴的package包/類

/**

* Opens this server's database instances. This method returns true If

* at least one database goes online, otherwise it returns false.

*

* If openning any of the databases is attempted and an exception is

* thrown, the server error is set to this exception.

*

* @throws HsqlException if a database access error occurs

*/

final boolean openDatabases() {

printWithThread("openDatabases() entered");

boolean success = false;

setDBInfoArrays();

for (int i = 0; i < dbAlias.length; i++) {

if (dbAlias[i] == null) {

continue;

}

printWithThread("Opening database: [" + dbType[i] + dbPath[i]

+ "]");

StopWatch sw = new StopWatch();

int id;

try {

id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,

dbProps[i]);

dbID[i] = id;

success = true;

} catch (HsqlException e) {

printError("Database [index=" + i + "db=" + dbType[i]

+ dbPath[i] + ", alias=" + dbAlias[i]

+ "] did not open: " + e.toString());

setServerError(e);

dbAlias[i] = null;

dbPath[i] = null;

dbType[i] = null;

dbProps[i] = null;

continue;

}

sw.stop();

String msg = "Database [index=" + i + ", id=" + id + ", " + "db="

+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]

+ "] opened sucessfully";

print(sw.elapsedTimeToMessage(msg));

}

printWithThread("openDatabases() exiting");

if (!success && getServerError() == null) {

// database alias / path list is empty or without full info for any DB

setServerError(Trace.error(Trace.SERVER_NO_DATABASE));

}

return success;

}

開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:67,

示例4: openDatabases

​點讚 2

import org.hsqldb.lib.StopWatch; //導入方法依賴的package包/類

/**

* Opens this server's database instances. This method returns true If

* at least one database goes online, otherwise it returns false.

*

* If openning any of the databases is attempted and an exception is

* thrown, the server error is set to this exception.

*

* @throws HsqlException if a database access error occurs

*/

final boolean openDatabases() {

printWithThread("openDatabases() entered");

boolean success = false;

setDBInfoArrays();

for (int i = 0; i < dbAlias.length; i++) {

if (dbAlias[i] == null) {

continue;

}

printWithThread("Opening database: [" + dbType[i] + dbPath[i]

+ "]");

StopWatch sw = new StopWatch();

int id;

try {

id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,

dbProps[i]);

dbID[i] = id;

success = true;

} catch (HsqlException e) {

printError("Database [index=" + i + "db=" + dbType[i]

+ dbPath[i] + ", alias=" + dbAlias[i]

+ "] did not open: " + e.toString());

setServerError(e);

dbAlias[i] = null;

dbPath[i] = null;

dbType[i] = null;

dbProps[i] = null;

continue;

}

sw.stop();

String msg = "Database [index=" + i + ", id=" + id + ", " + "db="

+ dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]

+ "] opened sucessfully";

print(sw.elapsedTimeToMessage(msg));

}

printWithThread("openDatabases() exiting");

if (isRemoteOpen) {

success = true;

}

if (!success && getServerError() == null) {

// database alias / path list is empty or without full info for any DB

setServerError(Trace.error(Trace.SERVER_NO_DATABASE));

}

return success;

}

開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:71,

注:本文中的org.hsqldb.lib.StopWatch.stop方法示例整理自Github/MSDocs等源碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值